Commit Graph

20 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
Louis Yung-Chieh Lo
66f4c2e700 Increase stack size of charger and chipset tasks.
(cherry-pick back to ToT)

The comment #20 of issue 29162 looks like a stack overflow to me.
The issue 29067 also shows the stack is overflowed in some case.
Let's increase that.

BUG=chrome-os-partner:29067,chrome-os-partner:29162
BRANCH=nyan,tot
TEST=build only. Should run RunIn.DozingStress.SuspendResume/RunIn.Reboot2.

Change-Id: Ic7fc7c8fa9e817b2db497ebedcdff6cb8c49c565
Origin-Change-Id: If3b97af578362eb6d2794b331716f499be7ad066
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204277
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206921
2014-07-08 02:13:30 +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
Vic Yang
ffac23c0ea Add cprints() and ccprints()
Our code base contains a lot of debug messages in this pattern:
  CPRINTF("[%T xxx]\n") or ccprintf("[%T xxx]\n")
The strings are taking up spaces in the EC binaries, so let's refactor
this by adding cprints() and ccprints().

cprints() is just like cprintf(), except that it adds the brackets
and the timestamp. ccprints() is equivalent to cprints(CC_CONSOLE, ...)

This saves us hundreds of bytes in EC binaries.

BUG=chromium:374575
TEST=Build and check flash size
BRANCH=None

Change-Id: Ifafe8dc1b80e698b28ed42b70518c7917b49ee51
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/200490
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-05-21 20:32:17 +00:00
Louis Yung-Chieh Lo
9e2fac8390 nyan: don't compile in shorthelp of console commands
Since stm32l has smaller flash size, undef CONFIG_CONSOLE_CMDHELP to
remove short descripton to save 2560 byes.
If you need to read the description, grep that in the code.

BUG=chromium:374575
BRANCH=tot,nyan
TEST=buildall and
% grep hey build/big/ec.RO.map
0x000000000000ef48
After shrink -->
0x000000000000e548

Change-Id: I856e89def6456607ade610134bf318d8522f5e4d
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/200472
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-05-20 07:34:54 +00:00
Dave Parker
6f21e3f5c1 Rename battery_vendor_params() to battery_override_params()
Charger V1 only. This is a clearer name for the intent of
the function to override the charging parameters requested
by the battery. This also disabmiguates this function with
a new host command to get and set arbitrary vendor
parameters in the battery.

BUG=chrome-os-partner:25145
BRANCH=ToT
TEST=`make buildall -j`.

Change-Id: I1e8762d359c0e91c5b2a539553d22c12c9850c03
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/195823
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/197164
Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2014-04-29 03:11:05 +00:00
cloud_lin
295e409ea9 Big: Correct the charger IC driver
Add bq24735 driver and move to here for further developing

BRANCH=big
BUG=None
TEST=test basic charing/discharging function

Change-Id: I66c22a29cf94383cec86c5cf53db82494504fa77
Reviewed-on: https://chromium-review.googlesource.com/196541
Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
Tested-by: Lin Cloud <cloud_lin@compal.com>
Commit-Queue: Lin Cloud <cloud_lin@compal.com>
2014-04-24 08:35:03 +00:00
Louis Yung-Chieh Lo
2e7ea4efdb battery: move cut-off commands to common/battery.c
So that host and EC commands will be defined in common/battery.c.
The board-specific battery.c can focus on the proprietary method.

BUG=chrome-os-partner:28248
BRANCH=tot,nyan
TEST=make buildall runtest
Tested "cutoff" in EC console on big.

Change-Id: I213c0d601d0241c8dea309d6ac60c72452d2d100
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/196621
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2014-04-23 22:59:51 +00:00
Louis Yung-Chieh Lo
67698db7da nyan: add info_precharge for drained battery
Charger v2 assumes the battery_get_info() always returns non-NULL even
if the battery is not detected, for example, in the over-drained
situation. Thus, add a new struct so that we know what the conservative
setting is to pre-charge the unknown battery.

BUG=chrome-os-partner:28112
BRANCH=nyan,big,blaze
TEST=See issue tracker for the test procedure.

Change-Id: Ica4fe75d154e2f195eb1da19ba045346da383b6c
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/195596
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Devin Lu <Devin.Lu@quantatw.com>
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
2014-04-22 20:27:01 +00:00
Louis Yung-Chieh Lo
2e41eb9eb9 tegra: move to charger v2.
This would move all tegra boards to charger v2.

Also removed the unnecessary charge_keep_power_off(), which was
designed for USB power port and doesn't apply to Tegra platform.

BUG=none
BRANCH=nyan,big,blaze
TEST=build and run on nyan.

Change-Id: I9517a8885726ad6dce5a2865402da4b9551e009f
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/194384
Commit-Queue: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Devin Lu <Devin.Lu@quantatw.com>
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2014-04-18 21:32:53 +00:00
cloud_lin
ccdce3f83d big: Modify LGC battery setting based on battery spec
1. Modify voltage_max
2. Set CP point

BUG=chrome-os-partner:27859
BRANCH=Big
TEST=Plug in AC and battery, use UART command "charger" to check
v_batt and I_in and the values are correct.

Change-Id: If83a444338e8d520e6c2f4d04ca6016c14cea8bd
Reviewed-on: https://chromium-review.googlesource.com/193584
Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
Commit-Queue: Lin Cloud <cloud_lin@compal.com>
Tested-by: Lin Cloud <cloud_lin@compal.com>
2014-04-12 05:54:04 +00:00
Louis Yung-Chieh Lo
be17ca9d91 big: fixed a LED corner case while almost full
Vic points out a corner case that the battery LED could be off by
the followng steps:

1. charge the battery to very full
2. disconnact the AC so that the LED is off for discharge.
3. plug AC again, then charger enters INIT state -->
   IDLE0 --> IDLE where those states don't toggle LED.

BUG=none
BRANCH=big
TEST=Reproduced this bug on big. Verified this has been fixed by this CL.

Change-Id: I7125acd6b11953675ac6d4085e31e0560b384015
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/189757
2014-04-01 02:46:34 +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
cloud_lin
24417669a6 Big: Add ectool discharge command.
BRANCH=big
BUG=None
TEST=Run ectool chargecontrol command with each option (normal,
 idle, discharge) on Big. Verifiy battery is discharging
 in discharge mode via EC console 'battery' command.
Signed-off-by: Cloud Lin <Cloud_Lin@compal.com>

Change-Id: Iab150c36df64016d06831a6a6c620742738ae2af
Reviewed-on: https://chromium-review.googlesource.com/189450
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
Tested-by: Lin Cloud <cloud_lin@compal.com>
Commit-Queue: Lin Cloud <cloud_lin@compal.com>
2014-03-18 11:24:20 +00:00
Louis Yung-Chieh Lo
c00675b909 cleanup: remove the conflict I2C2/GPIO config in nyan/big.
After Alex's CL 8a9817a, the i2c driver no longer hardcodes the
I2C port pin (Ya!). Remove the conflict pin setting in board files.

BRANCH=nyan,big
BUG=chrome-os-partner:26620
TEST=build and run on nyan board. Everything looks good.

Change-Id: Iee2c5f10f642da7ad00f503b6e615cb6aa472459
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/189245
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-03-13 23:22:29 +00:00
git-cloud_lin.compal.com
344c2fb865 Big: implement the power and battery LED behavior
Remove power_led_task and add the big-specific LED logic

BRANCH=big
BUG=None
TEST=manually
>> ectool led power blue:   PWR LED blue
>> ectool led power yellow: PWR LED orange
>> ectool led power off:    PWR LED off
>> ectool led power auto:   PWR LED auto control
>> ectool led battery blue:   BAT LED blue
>> ectool led battery yellow: BAT LED orange
>> ectool led battery off:    BAT LED off
>> ectool led battery auto:   BAT LED auto control
Signed-off-by: Cloud Lin <cloud_lin@compal.com>

Change-Id: I5ded361a46c627e4e4e6fcb6bddea9b487a46768
Reviewed-on: https://chromium-review.googlesource.com/188631
Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
Commit-Queue: Lin Cloud <cloud_lin@compal.com>
Tested-by: Lin Cloud <cloud_lin@compal.com>
2014-03-11 05:54:08 +00:00
cloud_lin
cb462f29c6 Big: add LGC 3s battery info
BRANCH=big
BUG=chrome-os-partner:26533
TEST=build ec and flash to big board; verify battery works

Signed-off-by: Cloud Lin <cloud_lin@compal.com>
Signed-off-by: Katie Roberts-Hoffman <katierh@chromium.org>

Change-Id: Ia005a549b8318b4f8df81e7b1341d50da28f4282
Reviewed-on: https://chromium-review.googlesource.com/188632
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
Commit-Queue: Katie Roberts-Hoffman <katierh@chromium.org>
Tested-by: Katie Roberts-Hoffman <katierh@chromium.org>
2014-03-07 03:41:36 +00:00
MilesDY_Chen
fcdb93668a Big: add 4s battery LGC AC14B8K support
Big can't be powered on by using 4s LGC AC14B8K battery.
Thus, add 4s battery definition to ec.

BRANCH=big
BUG=chrome-os-partner:26533
TEST=flash ec to big device and confirm battery works

Change-Id: I32d2eb2fabc70f3fc075a49a67c1fd4d30975981
Signed-off-by: MilesDY_Chen <MilesDY_Chen@compal.com>
Signed-off-by: Katie Roberts-Hoffman <katierh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/188651
2014-03-07 00:41:44 +00:00
Katie Roberts-Hoffman
f4f934c103 Add initial big support
BRANCH=big
BUG=chrome-os-partner:26533
TEST=emerge-nyan_big chromeos-ec; flash big board, verify
ec is alive and version is reported as big

Change-Id: Idbf84d029b5c7b7c198f8c4a2bd2a90d79524441
Reviewed-on: https://chromium-review.googlesource.com/188926
Tested-by: Katie Roberts-Hoffman <katierh@chromium.org>
Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
Commit-Queue: Katie Roberts-Hoffman <katierh@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-03-06 20:16:49 +00:00