Commit Graph

24 Commits

Author SHA1 Message Date
Anton Staaf
9797f654d9 Makefile: Add support for per-board symlinks to top level
Previously if you were working on a single board you had to add BOARD=
to all of your make command lines.  Now if you are in a board directory
you can just use "make", or "make clean", or any other top level make
command.

This commit also adds support for a top level "make flash" command that
can be used from the board directories as well.  This command uses
openocd and requires that the board provides an openocd-flash.cfg file.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

BRANCH=none
TEST=(from a few board directories) make clean; make -j
     (from the discovery-stm32f072 directory) make flash

Change-Id: Ie09a74881371169a2c3cd9cd9922f39f4873f1a6
Reviewed-on: https://chromium-review.googlesource.com/209669
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
2014-07-30 03:10:06 +00:00
Anton Staaf
7746b32e17 GPIO: Move definition of alternate functions to gpio.inc
This is a straightforward conversion of existing tables
into X-Macro style definitions for the GPIO alternate
functions.  This change in itself, is not particularly
powerful, but having all GPIO settings in a single file
makes a board easier to understand.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

BRANCH=none
TEST=make buildall -j
     Followed by manual testing of interrupt on change and UART
     functionality on STM32F0 based discovery board.

Change-Id: Ib7f1f014f4bd289d7c0ac3100470ba2dc71ca579
Reviewed-on: https://chromium-review.googlesource.com/207987
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
2014-07-17 00:39:52 +00:00
Anton Staaf
3500c28b50 gpio: Reformat gpio.inc files to use longer than 80-column lines
These files are tabular data more than source code.  We discussed
and concluded that the 80-column limit makes them harder to read,
not easier.  This commit reformats them to take advantage of
longer lines, mainly by putting per GPIO comments on the end of
the line that defines the GPIO.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

BRANCH=none
TEST=make buildall -j

Change-Id: I60f3e3620680196eb9462f97b34c453289240465
Reviewed-on: https://chromium-review.googlesource.com/205672
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
2014-07-01 00:43:04 +00:00
Anton Staaf
9ccfd4553e gpio: Replace duplication in gpio declarations with X-macro file
Previously each board.h and board.c contained an enum and an array
for gpio definitons that had to be manually kept in sync, with no
compiler assistance other than that their lengths matched.

This change adds a single gpio.inc file that declares all gpio's
that a board uses and is used as an X-macro include file to
generate both the gpio_signal enum and the gpio_list array.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

BRANCH=none
TEST=make buildall -j

Change-Id: If9c9feca968619a59ff9f20701359bcb9374e4da
Reviewed-on: https://chromium-review.googlesource.com/205354
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
2014-06-26 02:43:01 +00:00
Dave Parker
4b530d9fce Squawks: Adjust charge thresholds for altering LED behavior
The EC and host have different ways of computing and presenting
the battery charge level. This change adjusts the charge levels
at which the charging LED indicates a full and low battery to
match what is presented to the user in the host UI.

BUG=chrome-os-partner:27743,chrome-os-partner:27746
BRANCH=rambi,tot
TEST=Run "battfake 91" which charging, verify charging LED turns
green and the UI reports 95%.
Run "battfake  13" while discharging, verify charging LED blinks
amber (1 sec on, 1 sec off) and the UI reports 10%.

Change-Id: Iaffffb57a7fbfd14ebb90363cbd4aa1a9becf022
Original-Change-Id: I203c90a65e4aa2907a14077a9276674ecfa292f2
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/194347
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/195848
2014-04-22 00:47:29 +00:00
ChromeOS Developer
daeddb75e9 Rambi, Squawks: Clean up old comment on keyboard IRQ
The comment about cleaning up _NEW signals related
to the keyboard IRQ was taken care of by
https://chromium-review.googlesource.com/#/c/181718/4

BUG=None
BRANCH=ToT
TEST=make buildall -j 32

Change-Id: I635ec910b0c2f7fe686c9a7480095a65085e8a91
Original-Change-Id: I97e6f66340d9f8683ed69548cdbbe7c243c3b764
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185020
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192199
2014-04-01 00:47:28 +00:00
ChromeOS Developer
bc8ed17c5f Squawks: Fix manual control of the power LED
BUG=chrome-os-partner:25531
BRANCH=None
TEST=Run the following:
  ectool led power off
  ectool led power green
  ectool led power green=20
  ectool led power auto

Change-Id: I0f6808290a495666dc5c048c9a2198fc6dd337d5
Original-Change-Id: I6d2ad424da12b7db5b6a33acd281eecfe56f61e0
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/189603
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192198
2014-04-01 00:47:23 +00:00
ChromeOS Developer
8763e86df0 Squawks: Set adapter input current to 1575mA
Requested by ODM.

BUG=chrome-os-partner:24933
BRANCH=ToT
TEST=Verify input current with 'adc' console command
while system charging the battery and under heavy load.

Change-Id: I66a98852678758b4e73a7231d318b073ea5416c5
Original-Change-Id: I797a06cf4a3325c3895c6567d3e64465121efc70
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/189387
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192197
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-04-01 00:44:21 +00:00
ChromeOS Developer
b52b3d3282 Squawks: Add smart battery temp sensor to temp sensors list
BUG=None
BRANCH=ToT
TEST=Run "ectool temps all". Verify battery temp reported.
Remove battery, verify an error is reported.

Change-Id: Ib20a0fda29f7cb88f0415efa5ae0b58ecf912a72
Original-Change-Id: Id8e5c26dde3e1332208a1ea2744f14a56808caea
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/186414
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192196
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-04-01 00:44:17 +00:00
ChromeOS Developer
9dbf2d1143 Squawks: Enable low-power idle
BUG=chrome-os-partner:25377
BRANCH=None
TEST=Manual. Shutdown system. Verify "Disabling console
in deep sleep" message is displayed on EC console after
a few seconds. Boot and suspend system and perform the
same check.

Signed-off-by: Dave Parker <dparker@chromium.org>

Change-Id: I697395283a3deda323c02e2e025adb05ae4a4fc2
Original-Change-Id: I8d15ab1cab9ffb6b4ff5c01176b8015276f67326
Reviewed-on: https://chromium-review.googlesource.com/184966
Tested-by: Dave Parker <dparker@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192195
2014-04-01 00:42:11 +00:00
henryhsu
c5d408438a Fix EC_PWROK pin for Squawks evt board
BUG=chrome-os-partner:25298
BRANCH=rambi
TEST=manaully test on Squawks EVT board
Signed-off-by: Heng-ruey Hsu <henryhsu@chromium.org>

Change-Id: Ifc63dd22607c23719dedb6af8e570da4076ad8ee
Original-Change-Id: I932545e0bf0234eb9c3bdc399f5b29c9e4913951
Reviewed-on: https://chromium-review.googlesource.com/183904
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Heng-ruey Hsu <henryhsu@chromium.org>
Tested-by: Heng-ruey Hsu <henryhsu@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192194
Tested-by: Dave Parker <dparker@chromium.org>
Reviewed-by: Heng-ruey Hsu <henryhsu@chromium.org>
Commit-Queue: Dave Parker <dparker@chromium.org>
2014-04-01 00:42:07 +00:00
ChromeOS Developer
c82d35cdcf Squawks: Enable USB power in S3 if USB ports enabled at suspend
BUG=chrome-os-partner:24876
BRANCH=None
TEST=Suspend with a USB keyboard attached. On
the EC console, 'gpioget pp5000_en' should be 1.

Change-Id: Ic4ec175e2a5b51c433143e61e417d2171f1f99f2
Original-Change-Id: Ie7850617befa32dd2c2146ef23d18252ef6ea4a4
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/186673
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192193
2014-04-01 00:39:04 +00:00
ChromeOS Developer
1036c890cb Squawks: Default enable WLAN antenna and power in suspend
BUG=chrome-os-partner:25655
BRANCH=None
TEST=Verify WLAN_OFF_L = 1 and GPIO_PP3300_WLAN_EN = 1 in suspend.

Change-Id: I06df0a7c629e554fad110a9c3611d84035100af3
Original-Change-Id: I6d60fe78d51a1b6ef16b3e1df242025e927aa7d1
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/187994
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192192
2014-04-01 00:39:02 +00:00
Bill Richardson
a025f18673 Rename charge_state.[ch] to charge_state_v1.[ch]
Making room for a new charge_state implementation.

BRANCH=ToT
BUG=chrome-os-partner:23776
TEST=make buildall -j

No new functionality, just renaming some files.

Change-Id: I80ce861f09129a518e180cac20d32e867a93cd46
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/190852
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-03-20 23:51:00 +00:00
Randall Spangler
b805917e43 rambi: Remove ignored PCH signals
The EC had inputs with internal pullups on SUS_STAT#, SUSPWRDNACK, and
SLP_SX#.  But we never used those signals for anything.  The pullups
cost 1.5 mW power in S3.  So, remove those signals and their pullups.
They can be turned back on via CONFIG_CHIPSET_DEBUG.

BUG=chrome-os-partner:25568
BRANCH=rambi
TEST=build with and without CONFIG_CHIPSET_DEBUG.  Verify gpioget and
     powerindebug show the signals only when it's defined.

Change-Id: I0851243615c91a3aa8aa1b28df70809b578d2e74
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/188389
Reviewed-by: Dave Parker <dparker@chromium.org>
2014-03-01 21:57:41 +00:00
ChromeOS Developer
1cdd0d9b31 BayTrail: Fix ADC adapter current calculation
BUG=chrome-os-partner:25977
BRANCH=None
TEST=Run 'adc' console command on a heavily loaded system while
charging the battery. The current reported should be around the
CONFIG_CHARGER_INPUT_CURRENT limit.

Change-Id: I1b4089d00182ce7d286b387361a63edade626f38
Original-Change-Id: I18e5bbb0a45312afbcb7d989517a86b97646c2da
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/187018
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/187887
2014-02-26 01:52:50 +00:00
ChromeOS Developer
a78c59e4ac Add comment about matching temp sensor index and name with coreboot
BUG=None
BRANCH=rambi
TEST=None

Change-Id: I702173af23e6207129149bdb83ec7116fec8af66
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185394
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-02-12 00:40:33 +00:00
Randall Spangler
dad376eada baytrail: Battery cutoff return codes were backwards
cutoff() returns 0 on success, not non-zero.

BUG=chrome-os-partner:25646
BRANCH=rambi
TEST=ectool batterycutoff succeeds

Change-Id: Icca0c53aba82381b73dd679de5df3a97153d0662
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185737
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
2014-02-11 05:30:27 +00:00
ChromeOS Developer
c8c66cdb77 Squawks: Disable ectool i2c commands when write protected
BUG=None
BRANCH=None
TEST=Verify ectool i2cwrite, i2cread, i2cxfer commands fail
when EC is write protected.

Signed-off-by: Dave Parker <dparker@chromium.org>

Change-Id: Ie7c3a6ba1985c09f0cf05171eb32320191aebd8a
Original-Change-Id: Ibde29c92a1487932eb273701bdf017b4f92c646d
Reviewed-on: https://chromium-review.googlesource.com/182757
Commit-Queue: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-01-22 23:36:53 +00:00
Yung-Chieh Lo
8d3136f6b7 x86 & tegra: add CONFIG_POWER_COMMON.
For the better naming for power/common.h, we rename CONFIG_CHIPSET_X86
to CONFIG_POWER_COMMON (no one is actually using it). But keep
CONFIG_CHIPSER_TEGRA for power/build.mk.

BUG=chrome-os-partner:25068
BRANCH=nyan,falco,link,peppy,rambi,samus,squawks
TEST=build only

Change-Id: Ibf1a4c24088dfddac39b38a95b3b887c195152d5
Signed-off-by: Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/182732
2014-01-21 01:13:15 +00:00
Justin Chuang
fc91a7f7fd Support discharge on BQ24715 for Rambi and Squawks
BUG=chrome-os-partner:25031
BRANCH=rambi
TEST=Manually
  make BOARD=peppy
  make BOARD=falco
  make BOARD=rambi
  make BOARD=squawks
  On rambi and squawks, connect charger
     ectool chargecontrol discharge
     ectool i2cread 16 0 0x16 0x0a
     It should return 16-bit negative integer.

Change-Id: I8a8dfa90d2ad82595ac7a420c3c8ffc13b12cde6
Signed-off-by: Justin Chuang <jchuang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/182586
Reviewed-by: Dave Parker <dparker@chromium.org>
2014-01-16 06:43:05 +00:00
Randall Spangler
72481572aa Convert vboot hash calculation from task to deferred function
Vboot hash calculation takes ~350 ms during EC boot.  Since the hash
task is higher priority than the hook task, this starves all the hooks
during boot.

We could, in theory, fix that simply by swapping the priority of the
hook and hash tasks.  But then watchdog detection (in the hook task)
wouldn't detect hangs in the hash task.

A better fix (implemented here) is to convert the hashing operation to
a series of deferred function calls.  This gets rid of the hash task
entirely, and allows all pending hooks and other deferred function
calls to take place between each chunk of hashing.

On STM32-based boards, we need to bump up the hook task stack size,
since hashing is called from several layers deep in the hook task
instead of at the top of its own task, but this is still a net win of
several hundred bytes of SRAM.

BUG=chrome-os-partner:24892
BRANCH=rambi
TEST=Boot EC; look for "hash start" and "hash done" debug output.
     'taskinfo' shows at least 32 bytes of unused stack for HOOKS task.
     'hash ro' runs properly from EC console.

Change-Id: I9e580dc10fc0bc8e44896d84451218ef67578bbe
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181954
2014-01-09 20:25:11 +00:00
Louis Yung-Chieh Lo
9867f8379a x86: generalize power state machine for all platforms (2/2)
Rename x86_* to power_signal_* and X86_* to POWER_*.

BUG=chrome-os-partner:24832
BRANCH=link,falco,samus,rambi,peppy,squawks,snow,spring,nyan
TEST=make -j buildall run_tests

Change-Id: Ifaa06391da5a483851ff56eca91fbf6d038dff0a
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181719
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-01-09 05:30:49 +00:00
Randall Spangler
91abb52837 Add squawks board
Implement LED color policy (crosbug.com/p/23957)

Update battery vendor information (crosbug.com/p/24684)

BUG=chrome-os-partner:24885
BRANCH=rambi
TEST=manual
  system on, lidclose -> power LED off
  system on, lidopen -> power LED on
  system suspended -> power LED blinks green every 2 sec
  system suspended, lid closed -> power LED off
  system off -> power LED off
  plug AC in, battfake 95 -> charging LED green
  plug AC in, battfake 94 -> charging LED orange
  unplug AC, battfake 10 -> charging LED off
  unplug AC, battfake 9 -> charging LED blinks orange
  battcutoff -> after a few sec, system powered down
  plug back in AC -> system comes back on
  charger -> I_in < 1700

Change-Id: I89161e2c024d85197b8612a40a61dd50c106549e
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181755
2014-01-08 02:22:34 +00:00