Commit Graph

2037 Commits

Author SHA1 Message Date
Bill Richardson
57aaa0267e cleanup: Replace awkward I2C_PORTS_USED macro with constant
We only used I2C_PORTS_USED to iterate through the list of hardware ports
actually in use, but we defined it in board.h at the same place where we
matched particular I2C devices to the (possibly shared) buses they're on.

This CL makes I2C_PORTS_USED into a global constant, so it can be set
automatically where we initialize the ports, and doesn't have to be
related to the list of attached devices.

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

Build everything, run all tests, should still work.

Change-Id: I65f22f5cadfc4b3afe51af48faa5fb369bc3aa09
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171884
2013-10-07 16:20:59 +00:00
Duncan Laurie
616cc446e2 bolt: Make fan min/max be the same as link
The fan was not spinning enough to cool the system because it thought
the max fan speed was 5000.

BUG=none
BRANCH=bolt
TEST=build and boot on bolt, generate load and see that the fan comes
on to a reasonable level to cool the system.

Change-Id: Ifa5023534a6be8625abf7df7fa44aed649f4fabc
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171969
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-05 21:00:30 +00:00
Bill Richardson
e98db03d3b samus: Add battery_is_connected check
Copied from Bolt.

This is so the 30-second wait when no battery is installed can be skipped.

Note that if we ever decide to monitor the battery temp through the BAT_TEMP
line, we'll have to rethink how battery_is_connected() is implemented, since
we can't reliably treat that GPIO as both digital and analog simultaneously.

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

  cd src/platform/ec
  make BOARD=samus
  make runtests

Change-Id: Ifea952c8f99b2b40c2fab382e949958a2f71d157
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171796
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-10-04 20:04:49 +00:00
Bill Richardson
9af47b787c samus: alternate functions, charger
Adding some more board-specific configurations for Samus.

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

  make runtests

Change-Id: I86c909e899fb5bdb6ba75f476ced58bae2c75c29
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171809
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-04 20:04:44 +00:00
Duncan Laurie
ab55db590c bolt: Add battery_is_connected check
This is so the 30 second wait when no battery is installed
can be skipped.

Since Bolt needs a complete AC+Battery disconnect when updating
the BIOS this 30 second wait is aggravating.

BUG=chrome-os-partner:20448
BRANCH=bolt
TEST=disconnect AC+Battery, then connect AC and watch it boot
without waiting for 30 seconds.

Change-Id: Ibaf42fe1dba9c74aa465aa0a1a5381ba6981f66e
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171689
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-04 17:35:48 +00:00
Bill Richardson
9ef58858c4 Cleanup use of config.h macros
include/config.h should have the canonical list of all CONFIG_* macros used
everywhere else. This fixes some that weren't included, and some that had
been changed in one place but not in others.

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

Build everything. It should still work.

  cd src/plaform/ec
  make runtests

  for i in bds bolt daisy discovery falco kirby link mccroskey peppy pit puppy rambi samus slippy snow spring; do make BOARD=$i || touch died.$i; done

There shouldn't be any died.* files.

Change-Id: I0a1ec2d57668509c514dc5a521e547836a3e9894
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171690
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-04 01:54:46 +00:00
Bill Richardson
3990a8e323 samus: First pass at GPIOs
This is the first attempt at wiring the GPIOs for Samus. More to come, of
course.

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

The only thing we can check is that it compiles and doesn't break anything.

  cd src/platform/ec
  make BOARD=samus
  make runtests

Change-Id: Ia9dc94c420c21551c5db3e28e749954cea3055a1
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171528
2013-10-02 23:16:16 +00:00
Bill Richardson
523b52f750 Fix typo: s/GPOI_/GPIO_/g
Slippy, Peppy, and Falco should learn to spell.

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

  make runtests

Nothing uses this, it's just annoying to look at.

Change-Id: I61e09fc6a804c1de972b34520db1db8f0b874dbe
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171567
2013-10-02 21:59:07 +00:00
Bill Richardson
0550d92204 Internalize magic numbers for smart USB charging
Link is the only platform that uses smart usb ports. Link's board.h defines
USB_CHARGE_PORT_COUNT, yet the usb_port_power_smart.c file is peppered with
assumptions that that constant is always 2.

This moves the constant into usb_port_power_smart.c where it belongs.

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

  make runtests

Code refactoring only, no visible changes,

Change-Id: Id45e11d88585a98348105b1399c7e18c554add50
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171565
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-02 18:30:46 +00:00
Rong Chang
24986704af Always enable tpschrome low current charging
The PMU charger loop is conservative. And there is no need to set
hardware low charging current termination.

BRANCH=pit
BUG=chrome-os-partner:22946
TEST=manual
  Discharge the battery to level < 40%.
  Issue console command 'pmu', check register 0x09 output.
  The NOITERM bit(5) should be set to 1. That means no low charging
  current termination.

Signed-off-by: Rong Chang <rongchang@chromium.org>
Change-Id: I45532dcaab3bab566407b209f26693e2c3451014
Reviewed-on: https://chromium-review.googlesource.com/170906
Reviewed-by: Hung-ying Tyan <tyanh@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Jaehoon Kim <jh228.kim@samsung.com>
Tested-by: Jaehoon Kim <jh228.kim@samsung.com>
2013-10-02 09:19:42 +00:00
Randall Spangler
0f1f1229b9 lpc: Clean up processing wake events
Every board other than link does the same thing - filter out the power
button event, then set the WAKE_L gpio level based on the remaining
events.  This code doesn't need to be duplicated 7 times, so make it common.

Link didn't filter out the power button wake signal, but works fine
with the common implementation.  Like the other boards it gets a power
button wake event via the dedicated PCH PWRBTN# signal.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=suspend link, then wake using power button press
     compile all platforms; pass unit tests

Change-Id: Ib3a6d310d0f5e337374b3c331ab2872fe377bdf6
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171405
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-10-02 01:24:40 +00:00
Duncan Laurie
159867844a bolt: Fix panel power passthru
The Bolt board does not use the standard CHIPSET_HASWELL
and with a recent commit that meant haswell_interrupt() was
defined to NULL and it would not turn on the panel power.

BUG=chrome-os-partner:20372
BRANCH=bolt
TEST=build and boot on bolt and see magic working panel

Change-Id: I6174e2b4a8337acc2f395b8b2b18a00107661af1
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171112
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Randall Spangler <rspangler@chromium.org>
2013-10-02 00:09:39 +00:00
Randall Spangler
92df4552d5 lm4: Fix typo in eeprom code
We don't use the EEPROM block on the LM4 chip, but if we ever do we'll
want this off-by-one error fixed.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=Build bds, since that's the only board which even compiles this code.
     Pass unit tests.

Change-Id: I598f043cf00ebc1eca75fa6e6b7815d85a61e353
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171141
2013-10-01 19:12:14 +00:00
Randall Spangler
05c367d9ce Clean up G781 temperature sensor power detection
This was previously done in a board-specific function across 4 boards.
Except that the board-specific function was identical in all cases
(that is, not really board-specific).  Put it back in the common
implementation to get rid of duplicated code, and use
CONFIG_TEMP_SENSOR_POWER_GPIO to indicate which GPIO rail controls the
sensor power.

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

Change-Id: I29de40001d5d4dc873e5ba8f3abb328c6271f235
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171140
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-01 19:12:07 +00:00
Vic Yang
bd74ad1e20 Test more error cases of host command handling
This adds tests of invalid command version and invalid command.

BUG=chrome-os-partner:19236
TEST=Pass host_command test
BRANCH=None

Change-Id: I49ce1b4c8b31ef98d9ee8203e88adfa521471d6d
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170935
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-01 08:16:38 +00:00
Vic Yang
c77575ac0d Emulator support of fake GPIO input
For all GPIOs, the current values are recorded. A test can then change
the value of a GPIO input by gpio_set_level(). The changed value is
recorded and also interrupt is fired if the change fits the interrupt
flags defined in board/host/board.c.

BUG=chrome-os-partner:19235
TEST=Pass all tests
BRANCH=None

Change-Id: If8e547e5adf4a20dcb118f5fe2187293005d4ca3
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170907
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-10-01 08:16:34 +00:00
Aaron Gable
2d856c5103 Rewrite git/gerrit/gerrit-int urls to googlesource
BUG=chromium:281665,chromium:290413

TEST=None
BRANCH=none

Change-Id: Iaf8a245c0aa3a2a1838b80dc5b8dd0c7d62b1551
Signed-off-by: Aaron Gable <agable@google.com>
Reviewed-on: https://chromium-review.googlesource.com/171256
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-10-01 03:41:18 +00:00
Bill Richardson
af34e526db Create samus board config
This just does a copy/rename from Bolt. Tweaking for Samus' peculiarities
will come next.

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

The only thing we can check is that it compiles:

  cd src/platform/ec
  make BOARD=samus

Change-Id: Ied95ebdd1137548b21334b4a65a298c68482c517
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171081
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-30 18:58:19 +00:00
Randall Spangler
6d522eef9d Wake keyboard task when lid opens
If keyboard scanning is active when the lid closes, it will disable
scanning put the scan task to sleep.  We need a corresponding task
wake when the lid opens, or scanning will be stuck off (until
something else happens, like poking the power button).

BUG=chrome-os-partner:22190
BRANCH=peppy
TEST=Hold down a key.  Use a magnet to trigger the lid switch.  Scanning
     should stop while the lid is "closed", and restart when the magnet is
     moved to "open" the lid again.

Change-Id: I0a900f17f65b75cbdb45950cea7f50190d2bf9b1
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170993
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-09-30 18:58:15 +00:00
Randall Spangler
5ee634b1a5 Battery command needs to delay between iterations
The battery command takes a long time to run if given a high repeat
count.  Since it doesn't sleep at all between iterations by default,
this will unsurprisingly starve all other tasks and cause a watchdog
timeout.

Reset the watchdog between iterations, to give the rest of the system time
to do things.  This is similar to what we do in the i2cscan command.

BUG=chrome-os-partner:22232
BRANCH=none
TEST=apshutdown, then battery 1000 = no watchdog

Change-Id: I3ce55e15d90a6dfda34b1e2e332d7f7828922e78
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170968
2013-09-30 18:58:11 +00:00
Jeremy Thorpe
734916edfd Tool support for STM32L-Discovery board
Add the ChipID for the stm32l152c board to stm32mon.  Add discovery to the list
of supported boards in flash_ec.

BUG=None
TEST=With modified servo connector, see that image can be loaded onto
stm32l152c discovery board.
BRANCH=none

Change-Id: Ie16c64d17c907f7de765b09de98f534c486ae04c
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170981
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-09-28 04:21:21 +00:00
Vincent Palatin
f1d0d8b2db basic support for STM32L-Discovery board
Support for the basic development board built by STmicro with STM32L152
chip.

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

BUG=none
TEST=See that LEDs can be driven from the console, button can be read.  With
additional print statement, see that button hook is called.
BRANCH=none

Change-Id: I494ab525f17e08b57595ee49489ade63b3305f2a
Reviewed-on: https://chromium-review.googlesource.com/170920
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Jeremy Thorpe <jeremyt@chromium.org>
Tested-by: Jeremy Thorpe <jeremyt@chromium.org>
2013-09-28 03:21:00 +00:00
Randall Spangler
84ba188120 Support backlight control via lid only
The old backlight_x86 code did

  (backlight enable) = (lid is open) && (GPIO request from AP)

Newer systems will AND those signals in hardware.  Support those
systems by separating CONFIG_BACKLIGHT_LID and
CONFIG_BACKLIGHT_REQ_GPIO, and add tests for the case where the enable
signal is dependent only on the lid position.

BUG=chrome-os-partner:22960
BRANCH=none
TEST=pass unit tests

Change-Id: I1909426e49f00a8acd5047fd88c801cba1dacd76
Reviewed-on: https://chromium-review.googlesource.com/170925
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Randall Spangler <rspangler@chromium.org>
2013-09-27 23:07:21 +00:00
Vic Yang
1e16031f75 Add a test for x86 backlight passthrough
This checks x86 backlight passthrough by toggling lid switch and PCH
backlight output, and also by host command.

Also fix a bug that backlight switch host command can never be invoked
due to incorrect version mask.

BUG=chrome-os-partner:19236
TEST=util/make_all.sh
BRANCH=None (unless some platform needs backlight switch host command)

Change-Id: Iefc5f4b7387c4d2aa43059d073bd70aed879fe34
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170758
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-27 04:33:40 +00:00
Vic Yang
1b1bf3f03f Test charging error state when battery is detached
This checks charge state machine goes into error state when battery is
not responding.

BUG=chrome-os-partner:19236
TEST=Pass sbs_charging test
BRANCH=None

Change-Id: I61970c4d88cbb0d6242613cdc87b88da7ae3f2f4
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170753
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-27 04:33:36 +00:00
Vic Yang
4de56d4a7f Test interface for detaching fake I2C devices
This provides an interface to detach and re-attach fake I2C devices,
which can be used to test I2C connection failure.

BUG=chrome-os-partner:19235
TEST=Pass sbs_charging test along with the next CL
BRANCH=None

Change-Id: Ibfee79b13d45e62377d894aa28547e77bef2189e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170752
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-27 04:33:33 +00:00
Vic Yang
09de4c720d Merge smart_battery_stub.h to smart_battery.h
For testing, we are now mocking things at function-level instead of
file-level. No need to have separate header file for smart battery
functions now. Merge them back to smart_battery.h.

Just moving code. No functional change.

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

Change-Id: I4de1f73def447e75458118c1148c598794ddc091
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170751
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-27 04:33:28 +00:00
Andrew Bresticker
649b3e2714 Revert "pit: Disable CONFIG_HOST_COMMAND_STATUS"
The kernel driver now correctly handles EC_RES_IN_PROGRESS.

This reverts commit 62e9444161.

BRANCH=pit
BUG=chrome-os-partner:22825
TEST=Run flashrom, bang on the keyboard, and issue i2c commands to
TPSCHROME.  Observe that I2C_PASSTHRU and MKBP_STATE commands do not
interleave with GET_COMMS_STATUS commands

Change-Id: I8589552f6c7a1506a32b5510fe340dba29702e13
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170844
Reviewed-by: Simon Glass <sjg@chromium.org>
2013-09-27 03:03:07 +00:00
Vic Yang
9ce364fce0 Add test for LP5562 LED control
This adds a test for LP5562 LED control. The test mocks charging and
battery status and check LED behavior is as expected.

BUG=chrome-os-partner:19236
TEST=Pass the new test
BRANCH=None

Change-Id: Iac6b538b24c555bf48b6824f880091cd11a585d4
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170597
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-25 19:18:20 +00:00
Vic Yang
45bcffd91a Add test for memory-mapped switch information
This checks power button and lid switch states are updated correctly to
memory-mapped region.

BUG=chrome-os-partner:19236
TEST=Pass power_button and lid_sw tests
BRANCH=None

Change-Id: Ia49b5a3142b5fd47985bc6f53b1bbffd6d4bbeac
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170438
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-25 19:18:15 +00:00
Randall Spangler
20724deae6 cleanup: Remove unused fan channels
With the PWM interface refactoring, only the CPU fan uses the fan.h
interface.  All other PWM channels (keyboard backlight, etc.) use the
pwm.h interface.  Remove the unused constants, and rename FAN_CH_CPU
to CONFIG_FAN_CH_CPU so it fits with the other fan config options.

No functional changes; just renaming things.

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

Change-Id: I391fbeaf54afcc29a11c2799a4520b7ad8784796
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170534
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-09-25 17:50:07 +00:00
ChromeOS Developer
eb27bf14d4 rambi: Initial EC firmware
This should have all the correct GPIO mappings.

Chipset and charger tasks are currently disabled, until we bring up
the voltage rails and I2C communication.

BUG=chrome-os-partner:22895
BRANCH=none
TEST=compiles; everything else needs to wait until we get hardware

Change-Id: Iea49fe7ab8bd17f61c8cc6c71f236a503418ee28
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170540
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-09-25 17:50:00 +00:00
Paul Stewart
9ddc2f3cdc Revert "Set WLAN_OFF_L to open drain"
This reverts commit 03cc4b422d.

A change in plan (and schematics) dictate that the EC should/will be the sole driver of this signal.

Change-Id: I1e61ada1ae8579ae9a83c8410c38e3f5fe225bba
Reviewed-on: https://chromium-review.googlesource.com/170533
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2013-09-25 01:23:33 +00:00
Randall Spangler
a617846582 Make support for dedicated recovery GPIO signal optional
switch.c currently assumes that all boards have GPIO_RECOVERY_L.  This
is not true for Rambi, and also isn't true for ARM boards (which
should also eventually use the common switch implementation).

Add a new CONFIG_SWITCH_DEDICATED_RECOVERY option to control whether
to compile this support.

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

Change-Id: If6f34d1afd580c9d79a8edcdda18833068e70f66
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170489
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-09-25 01:23:29 +00:00
Bill Richardson
32d073f6c6 Add deprecated consts to ec_commands.h, just in case.
We've removed a few constants from the exported header file since the last
big sync. Just in case some of them are still in use (coredump, flashrom),
let's make it easy to redistribute the header unchanged. We can remove them
for real next time.

BUG=chromium:251441
BRANCH=none
TEST=manual

Compile, test, run, etc. This CL just adds back some unused (by the EC)
constants that were previously removed, so nothing should change.

Change-Id: Ia9889db89a90d56c8154fea1e8c8a483fdcae805
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170522
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-24 23:14:38 +00:00
jaehoon kim
d1da1250a8 stm32: snow: Fix the charging temperature range.
The value of start_charging_min_c and charging_min_c is 5 degrees C. To
meet the samsung specification, we have to change these values as 0
degrees C like pit.

BUG=chrome-os-partner:22882
TEST=Already checked the charging LED and the EC log in the oven.

Change-Id: Id6b6e1e61d5d8c2a3fcca7ff2ccc46e430ec2d7d
Signed-off-by: Jaehoon Kim <jh228.kim@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/170476
Reviewed-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-24 23:14:34 +00:00
Vic Yang
1e08d488bd Mock flash erase/write function at physical layer
This moves the mock function from common layer down to physical layer to
complete the test of common layer.

Also disable flash test for hardware tests, as this is only testing
common layer.

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

Change-Id: Idd1c2c44591952894486f84d428872cfbf2cfdad
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170297
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-24 21:00:25 +00:00
Paul Stewart
03cc4b422d Set WLAN_OFF_L to open drain
On bolt this pin is connected both to the PCH and the EC.
As designed, it was intended for both parts to treat this
as an open-drain circuit.

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

BUG=chrome-os-partner:22175
BRANCH=none
TEST=No good test yet, since PCH appears to drive all the time

Change-Id: Ib6ca16b4f797c8c334fb9f030f20cdbbc756f3fb
Reviewed-on: https://chromium-review.googlesource.com/170257
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2013-09-24 01:32:51 +00:00
Randall Spangler
29ee9c6d48 Support compiling with chipset task disabled
For bringup, we need to be able to compile a binary with the chipset
task disabled.  Chipset functions should be stubbed to do nothing in
that case.

BUG=chrome-os-partner:22820
BRANCH=none
TEST=compile falco, pit, link with chipset task commented out in ec.tasklist

Change-Id: I73a4e09effb049f19b1a128e643b267d6469037b
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170221
2013-09-23 21:26:29 +00:00
Randall Spangler
6277f7e336 Fix thermal.c compilation if fans are not present.
Currently, it doesn't compile unless CONFIG_FAN is defined.

BUG=chrome-os-partner:22803
BRANCH=none
TEST=temporarily undefine CONFIG_FAN in board/link/board.h; code compiles
     and all unit tests pass

Change-Id: I251d670ccd299f7a50b1455364a817e07fad4cb1
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170106
2013-09-23 21:26:26 +00:00
Randall Spangler
61c40db16c stm32: Fix polarity of charger interrupt
The charger interrupt is active-low.  Snow and Spring properly
triggered on falling (asserting) edge, but Pit (and Daisy/Puppy)
didn't.  Fix those boards, and rename the signal to end in _L so we
don't make that mistake again.

BUG=chrome-os-partner:22827
BRANCH=pit
TEST=unplug/replug AC adapter on pit; see debug output as follows:
	[batt] state charging -> idle0
	Charger IRQ received.
	[batt] state idle0 -> charging
	Charger IRQ received.

Change-Id: I1f5c9370d1118461dc033955ba77aab2cebb7ece
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170256
Reviewed-by: Jaehoon Kim <jh228.kim@samsung.com>
Tested-by: Jaehoon Kim <jh228.kim@samsung.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-09-23 19:23:58 +00:00
Vic Yang
a4f3a72cf8 Record average runtime and delay of hooks
In additional to recording the maximum runtime and delay, let's also
keep track of the moving average. The average is calculated by:
    New_Avg = (Old_Avg * 7 + New_Val) / 8
every time the hook fires.

The average values are only accurate for hooks that fire enough times,
but it won't be useful anyway for a hook that only fires just once or
twice.

Also, show warning if HOOK_TICK or HOOK_SECOND fires more than 10% late.

BUG=chrome-os-partner:21801
TEST=On Kirby, check average values are sane.
TEST='waitms 800' and see warning of HOOK_TICK firing late.
BRANCH=None

Change-Id: I453545830d854c6c5bfc795d01fc558a965cff6e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169704
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-23 06:10:32 +00:00
Randall Spangler
f27c007684 lm4: make CONFIG_UART_HOST optional
Currently, CONFIG_UART_HOST must be defined for all LM4-based
platforms.  Future platforms may not need host UART support, so make
it optional.

BUG=chrome-os-partner:22802
BRANCH=none
TEST=Temporarily comment out CONFIG_UART_HOST in board/link/board.h;
     code still compiles.

Change-Id: I8775d9daaf8f6e45f1f374c9be7f10316611447f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170104
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-09-20 20:44:54 +00:00
Randall Spangler
883dd51006 cleanup: move test mocks to board/host and remove unused mocks
Now that we have a better test framework in place, mock
implementations go in either chip/host/ or board/host/, depending on
whether they're mocking chip or common/board functionality.  Move the
remaining mocks there.  Also, several mocks were neither compiled nor
used, and haven't kept pace with other refactoring; delete those.

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

Change-Id: Ie2a81c3ccd4506679192d979aa87fe7ed6c1c5a0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169873
2013-09-19 23:30:03 +00:00
Jeremy Thorpe
a7f5224a83 Turn off backlight power when lid is closed.
Ensure that the backlight is off whenever the lid is closed,
independently of whether the AP asserts SUSPEND_L.

BUG=None
TEST=On Kirby, toggle lid switch closed and see that backlight turns off
immediately.
BRANCH=None

Change-Id: I1516be3b139a8cbb07a8a81229c8143c88118e91
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169875
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-19 02:42:00 +00:00
Randall Spangler
a95e80dd47 cleanup: move board-specific battery files to board dirs
The battery files contain board-specific constants and a few small
methods like battery-detect and battery-cut.  Most of these aren't
reused across platforms.  The battery files have also been cleaned up
so those board-specific constants basically all that's left in them.

Where a file is used by a single board only, move it to
board/(boardname)/battery.c.  Batteries used by more than one board
(e.g. battery_link.c used by both link and bolt) are still in
common/battery_*.c, since that's cleaner than duplicating the file in
each board's directory.

No code changes, just moving files.

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

Change-Id: I946c8eb874672c77f9b77105e5b900f98fa48d0f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169893
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-09-19 00:41:12 +00:00
Vic Yang
6aa88ffa4e Fix console channel name list
This adds back missing "hook" channel name. Also add a build assertion
to make sure we don't miss this again.

BUG=chrome-os-partner:21801
TEST=Build all boards. Remove "hook" channel and check build fails.
BRANCH=None

Change-Id: I373016504fd3753e1a791077d49b3af14b2b1aa4
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169703
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-18 22:09:04 +00:00
Dave Parker
2c16da8e91 Haswell: Add control for touchscreen reset
BUG=chrome-os-partner:22076
BRANCH=peppy
TEST=Manual. Verify touchscreen operational in S0.

Change-Id: Ife2d4e11142195bddf202933430ec8af243b1309
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/167150
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-18 22:09:00 +00:00
Yunlian Jiang
fe0b6c1acd ec: fix duplicate 'const' declarartion.
BRANCH=None
BUG=chromium:292965
TEST=CC="i686-pc-linux-gnu-clang" CXX="i686-pc-linux-gnu-clang++"
     emerge-x86-generic chromeos-ec passes.
Signed-off-by: yunlian@chromium.org

Change-Id: I936f5e9b3e6ab5a5c1c2f6b6c41d054d748545e3
Reviewed-on: https://chromium-review.googlesource.com/169633
Reviewed-by: Luis Lozano <llozano@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
2013-09-17 23:17:13 +00:00
Vic Yang
a2c962b7f6 Remove 'sb' and 'sbc' console commands
The functionality of these commands can be fully covered by 'i2cxfer'
command. Remove them to save code size.

BUG=None
TEST=Build all boards. Pass all tests.
BRANCH=None

Change-Id: I3f57e797530b17cff17b50feec80436ad7872409
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169510
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-09-17 03:22:34 +00:00