summaryrefslogtreecommitdiff
path: root/board/big
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: fix all the header guardsBill Richardson2015-06-181-3/+3
| | | | | | | | | | | | | | | This unifies all the EC header files to use __CROS_EC_FILENAME_H as the include guard. Well, except for test/ util/ and extra/ which use __TEST_ __UTIL_ and __EXTRA_ prefixes respectively. BUG=chromium:496895 BRANCH=none TEST=make buildall -j Signed-off-by: Bill Richardson <wfrichar@chromium.org> Change-Id: Iea71b3a08bdec94a11239de810a2b2e152b15029 Reviewed-on: https://chromium-review.googlesource.com/278121 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* mec1322: Simplify GPIO listsSteven Jian2015-05-271-47/+47
| | | | | | | | | | | | | | | Our existing GPIO macros use port# / gpio#, but the concept of different GPIO ports does not exist on the mec1322. Therefore, add new GPIO macros for chips which do not have distinct GPIO ports. BUG=None BRANCH=None TEST=make buildall -j Change-Id: Ibda97c6563ad447d16dab39ecadab43ccb25174b Signed-off-by: Steven Jian <steven.jian@intel.com> Reviewed-on: https://chromium-review.googlesource.com/262841 Reviewed-by: Anton Staaf <robotboy@chromium.org>
* gpio: Refactor IRQ handler pointer out of gpio_listAseda Aboagye2015-04-101-44/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the gpio_info struct, we had a irq_handler pointer defined even though a majority of the GPIOs did not have irq handlers associated. By removing the irq_handler pointer out of the struct, we can save some space with some targets saving more than others. (For example, ~260 bytes for samus_pd). This change also brings about a new define: GPIO_INT(name, port, pin, flags, signal) And the existing GPIO macro has had the signal parameter removed since they were just NULL. GPIO(name, port, pin, flags) In each of the gpio.inc files, all the GPIOs with irq handlers must be defined at the top of the file. This is because their enum values from gpio_signal are used as the index to the gpio_irq_handlers table. BUG=chromium:471331 BRANCH=none TEST=Flashed ec to samus and samus_pd, verified lightbar tap, lid, power button, keyboard, charging, all still working. TEST=Moved a GPIO_INT declaration after a GPIO declaration and watched the build fail. TEST=make -j BOARD=peppy tests TEST=make -j BOARD=auron tests TEST=make -j BOARD=link tests Change-Id: Id6e261b0a3cd63223ca92f2e96a80c95e85cdefb Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/263973 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
* Makefile: Add support for per-board symlinks to top levelAnton Staaf2014-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* GPIO: Move definition of alternate functions to gpio.incAnton Staaf2014-07-172-8/+4
| | | | | | | | | | | | | | | | | | | | | 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>
* Increase stack size of charger and chipset tasks.Louis Yung-Chieh Lo2014-07-081-2/+2
| | | | | | | | | | | | | | | | | | | | (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
* gpio: Replace duplication in gpio declarations with X-macro fileAnton Staaf2014-06-263-116/+60
| | | | | | | | | | | | | | | | | | | | | 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>
* Add cprints() and ccprints()Vic Yang2014-05-211-6/+6
| | | | | | | | | | | | | | | | | | | | | 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>
* nyan: don't compile in shorthelp of console commandsLouis Yung-Chieh Lo2014-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | 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>
* Rename battery_vendor_params() to battery_override_params()Dave Parker2014-04-291-3/+3
| | | | | | | | | | | | | | | | | | | | 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>
* Big: Correct the charger IC drivercloud_lin2014-04-241-1/+1
| | | | | | | | | | | | | | 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>
* battery: move cut-off commands to common/battery.cstabilize-5791.0.BLouis Yung-Chieh Lo2014-04-232-6/+5
| | | | | | | | | | | | | | | 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>
* nyan: add info_precharge for drained batteryLouis Yung-Chieh Lo2014-04-221-4/+29
| | | | | | | | | | | | | | | | | | 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>
* tegra: move to charger v2.Louis Yung-Chieh Lo2014-04-181-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* big: Modify LGC battery setting based on battery speccloud_lin2014-04-122-5/+8
| | | | | | | | | | | | | | | | 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>
* big: fixed a LED corner case while almost fullLouis Yung-Chieh Lo2014-04-011-1/+10
| | | | | | | | | | | | | | | | | | 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
* Rename charge_state.[ch] to charge_state_v1.[ch]Bill Richardson2014-03-201-0/+1
| | | | | | | | | | | | | | | 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>
* Big: Add ectool discharge command.cloud_lin2014-03-182-0/+13
| | | | | | | | | | | | | | | 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>
* cleanup: remove the conflict I2C2/GPIO config in nyan/big.Louis Yung-Chieh Lo2014-03-132-4/+0
| | | | | | | | | | | | | | 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>
* Big: implement the power and battery LED behaviortest-5619.Bgit-cloud_lin.compal.com2014-03-115-8/+178
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Big: add LGC 3s battery infocloud_lin2014-03-071-0/+24
| | | | | | | | | | | | | | | 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>
* Big: add 4s battery LGC AC14B8K supportMilesDY_Chen2014-03-071-1/+25
| | | | | | | | | | | | | | 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
* Add initial big supportKatie Roberts-Hoffman2014-03-065-0/+521
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>