summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* caroline_pd: remove CONFIG_SYSTEM_UNLOCKEDVincent Palatin2016-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Time to do some proper Write Protection testing. Rather than duplicating another time glados_pd board, just point to chell_pd board (whose only difference with glados_pd is CONFIG_SYSTEM_UNLOCKED) Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=glados BUG=chrome-os-partner:60814 TEST=test a few PD chargers and peripherals with the new firmware, and use flashrom to set the write-protection: flashrom -p ec:type=pd --wp-enable --wp-range 0 0x8000 flashrom -p ec:type=pd --wp-status Change-Id: I72fdd5518205ed9db3a2ec5ae7f95f6b6731cea9 Reviewed-on: https://chromium-review.googlesource.com/419035 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
* pbody: support g sensor, gyro and related functions.bolan.wang2016-12-124-84/+128
| | | | | | | | | | | | | | | | | | | | | | 1.add motionsense task and related CONFIGs, configure gpio 2.transfer enable_input_devices()'s role to lid_angle_peripheral_enable() 3.add some code associated with sensors BUG=chrome-os-partner:60235 chrome-os-partner:60236 BRANCH=firmware-glados-7820.B TEST= build and burn the board,check the sensor data is correct. ectool motionsense ectool motionsense lid_angle returned data and angle are right. Signed-off-by: bolan.wang <bolan.wang@bitland.com.cn> Change-Id: I9d8f2455156d687902fedf63a0d91a83832aa658 Reviewed-on: https://chromium-review.googlesource.com/416679 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: wang vanillan <bolan.wang@bitland.com.cn> Tested-by: wang vanillan <bolan.wang@bitland.com.cn>
* pd: Limit input current to 500mA on PD voltage transitionShawn Nematbakhsh2016-12-086-3/+54
| | | | | | | | | | | | | | | Upon requesting a PD power contract at a new voltage, keep the input current limit at 500mA until PD_RDY is received. BUG=b:30744563,chrome-os-partner:59311,chrome-os-partner:44340 BRANCH=ryu, gru, glados TEST=Manual on kevin, set ilim to 5V through `chglim` console command, attach zinger. Set ilim to 20V through `chglim`, verify that ilim goes from 3A to 500mA to 3A. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I452f183cfb958780e336a9f99dc6398356de17a0 Reviewed-on: https://chromium-review.googlesource.com/416286
* caroline: limit input current to 95% of the negotiated valueVincent Palatin2016-12-081-0/+5
| | | | | | | | | | | | | | | Account for the charger chip regulation accuracy plus margin to avoid going over the negotiated current value. BRANCH=glados BUG=chrome-os-partner:60693 TEST=Attach a Caroline charger through Twinkie and see 1.930A at 14.980V. Change-Id: Ifc2ebba73c16768eed1d874e4813a81fdda0d5fe Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/417800 Reviewed-by: Shawn N <shawnn@chromium.org>
* Cave: add CONFIG_DPTF_DEVICE_ORIENTATIONjames_chao2016-12-061-0/+1
| | | | | | | | | | | | | This config is removed in CL:394111 BUG=chrome-os-partner:53526 BRANCH=glados TEST=Test the dptf can be notify when flip to tablet mode Change-Id: I28fa315d16f14a13b9da0d443efa21c3ba6f553f Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/416094 Reviewed-by: Duncan Laurie <dlaurie@google.com>
* caroline: delay disabling V0.85A on PMICVincent Palatin2016-12-061-9/+41
| | | | | | | | | | | | | | | | | | In order to guarantee the V1.00A rail has 100ms to discharge, we delay the disabling of V0.85A by 50ms, instead of letting go on GPIO_PMIC_SLP_SUS_L transitions as other PMIC rails. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=glados BUG=chrome-os-partner:60501 TEST=hardware measurement Change-Id: I5047c765ab63aabe8c8ee6a5acdbdabb05192af1 Reviewed-on: https://chromium-review.googlesource.com/415735 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
* pbody: Modify to save spacebolan.wang2016-12-051-1/+19
| | | | | | | | | | | | | | | | 1. reduce usb PD log size 2. remove some debug modules BUG=chrome-os-partner:60236 BRANCH=firmware-glados-7820.B TEST= build and burn the board Signed-off-by: bolan.wang <bolan.wang@bitland.com.cn> Change-Id: Id3d8cdac17a724d236a9a088b857925db11e42db Reviewed-on: https://chromium-review.googlesource.com/414774 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: wang vanillan <bolan.wang@bitland.com.cn> Tested-by: wang vanillan <bolan.wang@bitland.com.cn>
* caroline: add back 'waitms' console commandVincent Palatin2016-12-021-1/+0
| | | | | | | | | | | | | | | | | | | The 'waitms' console command is used by FAFT to test the watchdog, put it back to complete the FAFT testing. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=glados BUG=chrome-os-partner:58326 TEST=emerge-caroline chromeos-ec (and see it fits in available flash) use 'waitms' on the EC serial console and see panic. Change-Id: I81ba33f4e0050ab69e13ffc8e294d273cfa62c06 Reviewed-on: https://chromium-review.googlesource.com/415307 Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* pbody: remove unused ALSbolan.wang2016-11-303-17/+1
| | | | | | | | | | | | | | | remove ALS to save space BUG=chrome-os-partner:60236 BRANCH=firmware-glados-7820.B TEST= build and burn the board Signed-off-by: bolan.wang <bolan.wang@bitland.com.cn> Change-Id: I7974b799153540c86a5ff3c8f036144cd20d4f8d Reviewed-on: https://chromium-review.googlesource.com/414834 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: wang vanillan <bolan.wang@bitland.com.cn> Tested-by: wang vanillan <bolan.wang@bitland.com.cn>
* Caroline: Set CTLV5ADS3 to AutoPuthikorn Voravootivat2016-11-301-22/+4
| | | | | | | | | | | | | | | Caroline does not have noise issue like Cave so there is no need to set CTLV5ADS3 to force PWM mode in S0. This sets CTLV5ADS3 to auto for power saving. BUG=chrome-os-partner:60383 TEST=Lower power consumption in S0 / No noise in Caroline Change-Id: I15d6bf77e6de563e47e81b6b0df1b09f84d13c76 Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/414535 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* pbody: support boot up with no batterybolan.wang2016-11-291-6/+2
| | | | | | | | | | | | | | BUG=chrome-os-partner:60002 BRANCH=firmware-glados-7820.B TEST=build and burn on the board. test no battery case,then insert AC it can boot up normally. Signed-off-by: bolan.wang@bitland.com.cn Change-Id: Iaba29314d7d77b0e2d5b88d75b8386bb3bd1429e Reviewed-on: https://chromium-review.googlesource.com/414731 Reviewed-by: Shawn N <shawnn@chromium.org> Tested-by: wang vanillan <bolan.wang@bitland.com.cn> Commit-Queue: wang vanillan <bolan.wang@bitland.com.cn>
* pbody: fix abnormal power state after "apshutdown"bolan.wang2016-11-291-0/+6
| | | | | | | | | | | | | | | | | run "apshutdown" in EC console, shutdown won't be successful and it will power up automatically. BUG=chrome-os-partner:59048 BRANCH=firmware-glados-7820.B TEST=build and burn on the board. run "apshutdown" in EC console, abnormal power state disappeared. Signed-off-by: bolan.wang@bitland.com.cn Change-Id: Ie25e841a8b677453688ca249d01a7c421ddb4860 Reviewed-on: https://chromium-review.googlesource.com/414684 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: wang vanillan <bolan.wang@bitland.com.cn> Tested-by: wang vanillan <bolan.wang@bitland.com.cn>
* pbody: Trigger PMIC shutdown rather than hibernate.bolan.wang2016-11-241-9/+17
| | | | | | | | | | | | | | | BUG=chrome-os-partner:60002 BRANCH=firmware-glados-7820.B TEST=build and burn on the board. do 'hibernate' in EC console,3.3V EC DSW goes 0V. when AC insert, lid open or power button press, that will power on. Change-Id: I8d077dd259ffe57021d5365f193de7d22bcdcd7d Reviewed-on: https://chromium-review.googlesource.com/412498 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: wang vanillan <bolan.wang@bitland.com.cn> Tested-by: wang vanillan <bolan.wang@bitland.com.cn>
* cave: fix the charger power thresholdShawn Nematbakhsh2016-11-231-1/+1
| | | | | | | | | | | | | BRANCH=glados BUG=chrome-os-partner:58657 TEST=`make buildall -j` Change-Id: I25946de8adafbc8265b873d0aca1fa428ad3b8e1 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/413039 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: BoChao Jhan <james_chao@asus.com> Commit-Queue: BoChao Jhan <james_chao@asus.com>
* Caroline: Set PMIC CTLV5ADS3 by system statePuthikorn Voravootivat2016-11-221-11/+26
| | | | | | | | | | | | | | | | | This CL is based on CL:408121 Set PMIC register 0x31 bit1:0 to 00 (forced pwm) when s0 for noise to 10 (auto) when suspend for power consumption BUG=chrome-os-partner:59752 BRANCH=firmware-glados-7820.B TEST=Test the power consumption in s3 Change-Id: Ibfcdb787caf148ecc36485f71dc72e9b1bce9b82 Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/413094 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* caroline: fix the charger power thresholdVincent Palatin2016-11-221-1/+1
| | | | | | | | | | | | | | | | | | | The current number doesn't make much sense, put a more sensible value in milliwatts. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=glados BUG=chrome-os-partner:58657 TEST=disconnect the battery on Caroline and plug the type-C charger, the machine no longer boots too early and never browns out. Change-Id: I855028413c740bd225f100f6aef7379746df5fe4 Reviewed-on: https://chromium-review.googlesource.com/413267 Tested-by: Vincent Palatin <vpalatin@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* clock: Fix clock_wait_cycles() asmShawn Nematbakhsh2016-11-183-6/+6
| | | | | | | | | | | | | | | | | | The 'cycles' register will be clobbered by our macro, so it must be specified as an output operand that may also be used as input. BUG=chrome-os-partner:60000 BRANCH=gru,strago,glados TEST=Build + burn wheatley, verify alignment exception is not encountered on boot. Also verify produced assembly is still correct: 100a89a6: 2303 movs r3, #3 100a89a8: 3b01 subs r3, #1 100a89aa: d1fd bne.n 100a89a8 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I1be03a006967aed6970dbac5d98a19a31e0b7d49 Reviewed-on: https://chromium-review.googlesource.com/412351
* CHERRY-PICK:Makefile.rules: Add targets to see file size differencesMartin Roth2016-11-172-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the ec binaries are so tight on space, it would be nice to be able to see just how much changes are affecting the size. This allows users to easily do before/after comparisons. Sample output: build/sweetberry/RW/ec.RW.flat shrank by 44 bytes: (43828 to 43784) build/twinkie/RO/ec.RO.flat shrank by 64 bytes: (46312 to 46248) build/twinkie/RW/ec.RW.flat shrank by 40 bytes: (45900 to 45860) build/wheatley/RW/ec.RW.flat shrank by 40 bytes: (102692 to 102652) Compared 156 of 156 files. 81 files changed. Total size change: -3100 bytes. Average size change: -38 bytes. BRANCH=none BUG=none TEST=make clobber buildall -j; make savesizes [change some code that changes file sizes] make clobber buildall -j ; make newsizes [Shows size differences] Change-Id: I3dbb93f517473007b7bd9ca0a7beaca24b9f330f ORIG-Change-Id: I48b440063eb6eb6c00900af3d0dfa075be6f9ec7 Signed-off-by: Martin Roth <martinroth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/410860 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/411665 Reviewed-by: Shawn N <shawnn@chromium.org>
* Cave: add useful debug setting for pd and sensorsjames_chao2016-11-171-0/+4
| | | | | | | | | | | | | | | | | Add CONFIG_CMD_ACCELS and CONFIG_CMD_ACCEL_INFO, maybe help for debug the motionsense sensor issue. Set CONFIG_USB_PD_DEBUG_LEVEL=1 for print pd state name, the uart output message will be more readable. BUG=none BRANCH=firmware-glados-7820.B TEST=test on the EC uart console Change-Id: I1c99ba32021087d24d81fdfad5bec072913e37ee Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/411566 Reviewed-by: Shawn N <shawnn@chromium.org>
* CHERRY-PICK: pd_task: print pd state nameKevin K Wong2016-11-173-18/+37
| | | | | | | | | | | | | | | | | | | | | Shifted pd_task debug level by 1 so that debug level 1 will enable printing the pd state name. Added a CONFIG flag to remove ability to change debug_level during runtime and debug print level will be fixed. BUG=none BRANCH=none TEST=make buildall Change-Id: I9340d8fdb84c2d354cd2f5f87297fa8f88adf599 ORIG-Change-Id: I545813bafa8084355cedc2d8334c3aec5a2b6739 Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/339935 Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org> Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/411565
* kionix: Add reading whoami to be sure device has booted.Gwendal Grignou2016-11-162-1/+28
| | | | | | | | | | | | | | | | | | From the specs, "KX022-1020 Specifications Rev4.0", the power up time can be as long as 10ms. Add a loop to be sure the device is responsive before initalizing it. BRANCH=reef,glados,oak,veyron,cyan BUG=chrome-os-partner:59870 TEST=After putting a KX022 accel as first in the list, it would not initialize properly. After adding the loop, it initializes properly. Reviewed-on: https://chromium-review.googlesource.com/394750 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> (cherry picked from commit 09f90a3b8f0f48d11b3653ad2af1d61c29691a48) Change-Id: I3194a5d1deb0c2eb2a04a459aab3b4269e479af3 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/411928
* Cave: add CONFIG_HOSTCMD_ALIGNED, CONFIG_WATCHDOG_HELPjames_chao2016-11-151-0/+3
| | | | | | | | | | | | | | add CONFIG_HOSTCMD_ALIGNED for more code space, add CONFIG_WATCHDOG_HELP for watchdog debug. BUG=none BRANCH=firmware-glados-7820.B TEST=build and test on cave, check the hostcmd is working. Change-Id: I7ffff433f0c8d03cfa875f62cba1b5708689e9b8 Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/411564 Reviewed-by: Shawn N <shawnn@chromium.org>
* CHERRY-PICK: npcx: shi: Remove support for V2 host protocolShawn Nematbakhsh2016-11-151-168/+4
| | | | | | | | | | | | | | | | | BUG=chrome-os-partner:52372 BRANCH=None TEST=Verify V3 host command interface is still functional. Change-Id: I9370ae5e0cf1f06d4854a193701a88aada12db8f Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> ORIG-Change-Id: I75e684f3fbce764965ddac47b8314ed298086d74 Reviewed-on: https://chromium-review.googlesource.com/339472 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/411563 Commit-Queue: BoChao Jhan <james_chao@asus.com> Tested-by: BoChao Jhan <james_chao@asus.com>
* CHERRY-PICK: Support alignment for EC host command structuresRandall Spangler2016-11-157-407/+530
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The host command parameter and response buffers should be explicitly aligned by the LPC/SPI/I2C drivers. But the host command handlers don't know that, and the structs are all __packed, so the compiler generates horribly inefficient ARM Cortex-M code to cope with unaligned accesses. Add __ec_align{1,2,4} to force the param / response structs to be aligned. Use it in a few structs now which were straightforward to test. It should be added to more structs as space is needed, but that would make this change unwieldy to review and test. Add CONFIG_HOSTCMD_ALIGNED to enable the additional alignment. Currently, this is enabled only for LM4 and samus_pd, so that EC code can be tested without affecting other non-samus ToT development (none of which uses LM4). Fix the two handlers that weren't actually aligned (despite one of them having comments to the contrary). Also, add a CHROMIUM_EC define that can be used to determine if a file is being compiled for an EC target. We need that so that we only force structure alignment for EC binaries. On the AP side, buffers may not be aligned, so we should not force alignment. BUG=chromium:647727 BRANCH=none TEST=Flash samus and samus_pd. Boot samus and run a bunch of ectool commands (with and without --dev=1, so it tests both EC and PD). System boots and all commands return expected results. Change-Id: Ia0fcdea001e3a0350d67b5a42b0236023ce197b8 ORIGIN-Change-Id: I4537d61a75cf087647e24281288392eb85f22eba Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/387126 Reviewed-on: https://chromium-review.googlesource.com/411562 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: BoChao Jhan <james_chao@asus.com> Tested-by: BoChao Jhan <james_chao@asus.com>
* motion_lid: Use common tablet mode API.Aseda Aboagye2016-11-151-4/+2
| | | | | | | | | | | | | | | | | | | In my previous commit, I accidentally added a motion_lid local tablet_mode flag when I should be using the common tablet_mode APIs instead. The net result would be that tablet mode changes weren't actually reflected. This commit changes motion_lid to use the tablet mode APIs. BUG=none BRANCH=glados TEST=make -j buildall Change-Id: I3a88c8c523816ef9f14a586636ffc8d2123f31f6 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/411401 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* cave: Add `waitms` command back in.Aseda Aboagye2016-11-151-1/+0
| | | | | | | | | | | | | | | | | We rely on the `waitms` command for FAFT tests and it was missing from cave. This commit adds it back in. BUG=chrome-os-partner:59751 BRANCH=glados TEST=build cave; verify 'waitms` command is still there. Change-Id: Ib021b2c05f747b5437d2642717af3a26e274c526 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/411464 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: danny chan <dchan@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* mec1322: Place `idlestats` behind config option.Aseda Aboagye2016-11-151-2/+2
| | | | | | | | | | | | | | | | | The `idlestats` command was not behind the CONFIG_CMD_IDLE_STATS option; this commit fixes that. BUG=None BRANCH=glados TEST=build a board that uses mec1322. Undef CONFIG_CMD_IDLE_STATS; verify that the command isn't present in the build. Change-Id: Id17c8377f812ee2a63dc4507766c1c557704dcb1 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/411463 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* pbody:fix for the faft test case firmware_ECBootTimebolan.wang2016-11-151-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove system_get_board_version() from function board_handle_reboot(). System must be restarted by triggering PMIC with flag RESET_FLAG_AP_OFF during firmware_ECBootTime testing. Otherwise, the following error message will be encountered: Setting ec_uart_regexp to ['(?ms)UART.*UART.*?\\[([0-9.]+) '] Setting ec_uart_cmd to reboot ap-off Unable to parse EC console output, 9 more attempts ... Setting ec_uart_cmd to reboot ap-off Unable to parse EC console output, 1 more attempts ... TestFail: Unable to reboot EC cleanly, Please try removing AC power BUG=chrome-os-partner:57548 BRANCH=firmware-glados-7820.B TEST=build and burn on pbody pass firmware_ECBootTime Signed-off-by: bolan.wang@bitland.com.cn Change-Id: Id7d5840155a97758fcebbcabe02183f8aba4baf1 Reviewed-on: https://chromium-review.googlesource.com/410962 Commit-Queue: wang vanillan <bolan.wang@bitland.com.cn> Tested-by: wang vanillan <bolan.wang@bitland.com.cn> Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* Cave: set thermel sensor shutdown temperaturejames_chao2016-11-152-8/+5
| | | | | | | | | | | | | Remove the 'CONFIG_WATCHDOG_HELP' for more code space BUG=none BRANCH=firmware-glados-7820.B TEST=check the system chould shutdown when over temperature Change-Id: Ie4c78078bbbfa1ad2a7e18eac495fd4df5ad8179 Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/410480 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* motion_lid: Make tablet mode great (again).Aseda Aboagye2016-11-141-7/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chrome seems to pay attention to the tablet mode switch reported by the EC. However, for some devices that don't actually have a switch and use the lid angle as a "virtual" switch, it's possible for invalid tablet mode change events to be reported. This is because a single reading could flip the switch. This commit adds some debouncing to the tablet mode event changes. Instead of having a single event be able to change the tablet mode switch, we will now perform TABLET_MODE_DEBOUNCE_COUNT number of calculations of the new tablet mode value. If those calculations all agree, then we'll flip the switch. This should help mitigate false tablet mode change events caused by spurious forces. BUG=chrome-os-partner:59203 BUG=chrome-os-partner:59480 BRANCH=gru TEST=flash kevin; open lid to pi/2 rad; rotate device counter-clockwise pi/2 rad; shake device and verify that tablet mode doesn't change easily. TEST=verify that tablet mode still works. Change-Id: Id020f7db28e93e53b276b3f0d28a40251f035f0b Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/410944 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
* Sentry: modify Green Book settingBruce2016-11-131-5/+6
| | | | | | | | | | | | | | | Do green book support after check the return state of these calls. BUG=None BRANCH=firmware-glados-7820.B TEST=make buildall Change-Id: Ic01e57b434f4acaf1fa7ea31b6381d0eeda00dcc Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/405889 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Keith Tzeng <keith.tzeng@quantatw.com> Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
* asuka: update thermal tableLennon Chen2016-11-121-6/+7
| | | | | | | | | | | | | | | Update thermal thermal table by referring to KS13_Chr-Thermal Policy_X04_1104.xlsx. BUG=chrome-os-partner:59385 BRANCH=glados TEST=`make buildall -j` and enter "thermalget" to get thermal information. Change-Id: Ia05317af29a85201274da6e678fa0067c168bbc8 Signed-off-by: Lennon Chen <Lennon_Chen@wistron.com> Reviewed-on: https://chromium-review.googlesource.com/408116 Reviewed-by: Shawn N <shawnn@chromium.org>
* Cave: Set PMIC CTLV5ADS3 by system statejames_chao2016-11-081-12/+25
| | | | | | | | | | | | | | | | Set PMIC register 0x31 bit1:0 to 00 (forced pwm) when s0 for noise to 10 (auto) when suspend for power consumption BUG=chrome-os-partner:55742 chrome-os-partner:58996 BRANCH=firmware-glados-7820.B TEST=Test the power consumption in s3 Change-Id: I0a34eded5c015ce32e11e322b35114135a90af34 Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/408121 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* board: Set reserved memory size and other parameter to compile.Gwendal Grignou2016-11-043-1/+10
| | | | | | | | | | | | | | | | Decrease shared memory size on caroline and cave to fit memory footprint. Remove yet another function from samus_pd to compile. BUG=chrome-os-partner:59081 BRANCH=glados TEST=buildall Change-Id: Ia3c31293ca12f258252f3ef72c232a0228284e34 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/404635 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* common: Check at compile time for shared memory space.Vincent Palatin2016-11-046-3/+61
| | | | | | | | | | | | | | | | | | | | | Some functions (signing, keyboard log) assume there is at least 1KB of memory free for sharing. This is not true anymore, esp. when the sensor hub allocates a large FIFO. Add check in lds file to ensure there is enough free space available, even after removing space for panic and sysjump. Add a variable to change the amount of reserved shared space, use that amount when setting chunck sizes. BUG=chrome-os-partner:59081 BRANCH=glados TEST=Check on Cave that signing works in RO. Before that, it was only working in the RW image. Change-Id: I97db326c14da71a63e692cef53709ebd62f94232 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/404634 Tested-by: Vincent Palatin <vpalatin@chromium.org>
* driver: bmi160: Autocalibrate Accelerometer properly.Gwendal Grignou2016-11-021-1/+6
| | | | | | | | | | | | | | | | | Take into account the rotation matrix to do calibration. In particular the Z axis: if board is upside down, we need to use MINUS_1G instead of PLUS_1G when setting online calibration. BRANCH=kevin BUG=none TEST=Before, calibration would not work on the Z axis. Change-Id: Ifaec331aac40a4be0e34fcab5dd3752d2d59b91f Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/405854 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> (cherry picked from commit cd30d638ab60e5d1821e0fff22051f482cf7a5a7) Reviewed-on: https://chromium-review.googlesource.com/406573
* pbody: add power led support for host command controlvanillan wang2016-11-021-2/+30
| | | | | | | | | | | | | | | | BUG=chrome-os-partner:59264 BRANCH=firmware-glados-7820.B TEST=build and burn on pbody ectool led power off ectool led power white ectool led power auto Signed-off-by: bolan.wang@bitland.com.cn Change-Id: Ib8a6f247427d98a9ee13b5a5037421716d00a7f4 Reviewed-on: https://chromium-review.googlesource.com/406817 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: wang vanillan <bolan.wang@bitland.com.cn> Tested-by: wang vanillan <bolan.wang@bitland.com.cn>
* caroline: disable trackpad in tablet modeVincent Palatin2016-10-312-2/+20
| | | | | | | | | | | | | | | | | | | | | The (new) TRACKPAD_INT_DISABLE GPIO is preventing the trackpad interrupt line going to the AP from triggering events (when we are in tablet mode). Note: on previous hardware without this modification, this will likely prevent the trackpad from working. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=glados BUG=chrome-os-partner:57993 TEST=put the laptop in tablet mode, see that trackpad input is ignored, go back to regular laptop mode and see that trackpad is working. Change-Id: Ie9577d93cf058b102f50c109240c5d4bd6af5cb3 Reviewed-on: https://chromium-review.googlesource.com/404208 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
* Asuka: Add board support for asserting RTCRSTLennon Chen2016-10-312-0/+12
| | | | | | | | | | | | | | | | Enable CONFIG_BOARD_HAS_RTC_RESET and add a board_rtc_reset() function to assert RTCRST to the PCH that will be called if the board fails to sequence out of the S5 state. BUG=none BRANCH=glados TEST=make buildall, confirm RTCRST asserts if SLP_S4 does not deassert and then system can power on normally. Change-Id: I2bfc758bfa694236d33475a12db402347df3fe72 Signed-off-by: Lennon Chen <Lennon_Chen@wistron.com> Reviewed-on: https://chromium-review.googlesource.com/404597 Reviewed-by: Shawn N <shawnn@chromium.org>
* Asuka: Fan rotation speed is abnormally high when system goes to S3Lennon Chen2016-10-291-1/+1
| | | | | | | | | | | | | | | | | | | Modify thermal_params table(set fan_off and fan_max to 0) to fix abnormal fan rotation speed in S3. BUG=chrome-os-partner:59099 BRANCH=glados TEST=`make BOARD=lars -j` 1.Run the Aquarium Fish tank web test. 2.Wait for the temperature of CPU increase, then enter S3. 3.Check fan stop when system in S3. Change-Id: I40bcc7415d2a97e9ac26094edf908e5c840626a2 Signed-off-by: Lennon Chen <Lennon_Chen@wistron.com> Reviewed-on: https://chromium-review.googlesource.com/404712 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Sean Chiang <sean_fs_chiang@wistron.com> Tested-by: Sean Chiang <sean_fs_chiang@wistron.com>
* caroline: Add ARC++ sensor supportVincent Palatin2016-10-253-71/+90
| | | | | | | | | | | | | | | | | | | | Add ARC++ sensor support by defining a FIFO and reordering sensor array. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:57993 BRANCH=glados TEST=With AIDA64, check sensors report information. Check that the lid angle is calculated properly both by EC (with 'ectool motionsense lid_angle') and Chrome (switch to Tablet mode over 180 degrees and rotate the screen properly). Change-Id: Ib6f2d04487e40db8053157ffa3ee673fe21aedc3 Reviewed-on: https://chromium-review.googlesource.com/402848 Tested-by: Vincent Palatin <vpalatin@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* caroline: Enable Tablet Mode using the lid angle.Gwendal Grignou2016-10-221-0/+2
| | | | | | | | | | | | | Use the lid angle to determine if the device is in tablet mode. BUG=chromium:606718 BRANCH=glados TEST=Compile. Change-Id: I9445554bb04817f817a00583aa8c48bd2207e142 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/402091 Reviewed-by: Shawn N <shawnn@chromium.org>
* cave: Use Tablet GPIO to get tablet mode.Gwendal Grignou2016-10-222-13/+7
| | | | | | | | | | | | | | | | Use the Tablet GPIO instead of lid angle calculation to detect tablet mode. BUG=chromium:606718 BRANCH=glados TEST=Check with Cave that both mode works: with AIDA64, in tablet mode, check the sensor value when the lid is opened closed. If lid is away from the base, the sensor data is not transformed. Change-Id: I1a842ea8e2842dee83ddf69a9a474debe7f9c180 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/402090 Reviewed-by: Shawn N <shawnn@chromium.org>
* common: Add tablet_mode APIGwendal Grignou2016-10-229-26/+46
| | | | | | | | | | | | | | Simple API to set/get the tablet mode. It can be set via lid angle calculation or if a board has a dedicated HAL sensor/GPIO. BUG=chromium:606718 BRANCH=glados TEST=Check with Cave that both mode works. Change-Id: I2ee5130f3e0a1307ec3ea543f7a32d66bc32b31d Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/402089 Reviewed-by: Shawn N <shawnn@chromium.org>
* cave: Enable BMI160 interrupt.Gwendal Grignou2016-10-211-0/+3
| | | | | | | | | | | | | Enable BMI160 interrupt in board_init(). BUG=b:27849483 BRANCH=glados TEST=buildall. Change-Id: I3ed4fe9bd9cdb71a0b743d9814fef48bb790e807 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/402052 Reviewed-by: Shawn N <shawnn@chromium.org>
* task: Don't propagate TASK_EVENT_TIMER between between waitsShawn Nematbakhsh2016-10-213-3/+12
| | | | | | | | | | | | | | | | | In __wait_evt(), if a timer expiration occurs after we read event status, before the timer is canceled, then TASK_EVENT_TIMER will be propagated to the next task wait, likely leading to premature timeout. Prevent this by clearing TASK_EVENT_TIMER after canceling our timer. BUG=chrome-os-partner:58658 BRANCH=gru,glados TEST=Manual on gru, run 'pd # hard' for 12 hours with charger attached, verify no TCPC I2C read errors occur. Change-Id: Iac2f05a768b4ef29f82e7c3eb899f4c7dd5c3744 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/401654 Reviewed-by: Gwendal Grignou <gwendal@google.com>
* cave: Reremove CONFIG_SYSTEM_UNLOCKED define.Gwendal Grignou2016-10-211-6/+0
| | | | | | | | | | | | | Readded by mistake in cl/394111 BRANCH=oak BUG=none TEST=Check config is gone in build/cave/.config. Change-Id: Id4d41eb88630beaa97d019589e9d1b22e419b079 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/401751 Reviewed-by: Shawn N <shawnn@chromium.org>
* cave: Add ARC++ sensor supportGwendal Grignou2016-10-214-64/+103
| | | | | | | | | | | | | | Add ARC++ sensor support by defining a FIFO and reordering sensor array. BUG=b:27849483 BRANCH=glados TEST=With adai64, check sensors report information Check lid angle is calculated properly both by EC and chrome. Change-Id: I8090367022423badf55bfe8e48ca0ec4f6957f80 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/394111 Reviewed-by: Shawn N <shawnn@chromium.org>
* spi_flash: command flashinfo optionalGwendal Grignou2016-10-212-0/+3
| | | | | | | | | | | | | | | To save space, add #define around flashinfo console command. When disabled, the information can still be retrieve via ectool. BUG=none BRANCH=glados TEST=compile, check we save enough space to fit ARC sensor support in Cave. Change-Id: I4c159da9e1c1679dc1f14834ea15b5d5185cf5f4 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/401693 Reviewed-by: Shawn N <shawnn@chromium.org>
* driver: kionix: Set resolution and range to a fix number.Gwendal Grignou2016-10-212-29/+17
| | | | | | | | | | | | | | | | To save space, set the resolution to its maximum and range to +/- 8G. Range is never set from the AP, Android assume 8G. Resolution is never set from the AP set to 12/16bit depending on the accelerometer. BRANCH=glados BUG=b:27849483 TEST=compile, save 384 bytes. Change-Id: Iee359e600e7cfa03551fe4656f40cb41e123a856 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/393984 Reviewed-by: Shawn N <shawnn@chromium.org>