summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cr50: Add vendor command to set U2F modestabilize-12441.BLouis Collard2019-08-212-0/+19
| | | | | | | | | | | | | | | | The existing U2F command will be deleted, as it is part of the legacy U2F implementation; this command is a replacement for it. BRANCH=none BUG=b:138578925 TEST=run u2fd with --g2f and --u2f, check G2F cert to verify mode is respected Signed-off-by: Louis Collard <louiscollard@chromium.org> Change-Id: I3956809248bb35baaaecdeef66f2fa35832aa421 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1748846 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* util/presubmit_check.sh: Exclude README.md and navbar.md filesTom Hughes2019-08-211-0/+4
| | | | | | | | | | | | | | | These files aren't used by "make buildall", so it shouldn't cause a developer to run "make buildall" before submitting a change to the file. BUG=None BRANCH=None TEST=Modify navbar.md. Try to upload and verify that the presubmit check does not flag it. Change-Id: Ia4eaa7009aa52b7a096171e66e6541694ef73032 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1758539 Reviewed-by: Jett Rink <jettrink@chromium.org>
* cleanup: remove redundant header file includeJett Rink2019-08-201-1/+0
| | | | | | | | | | | | The header file includes itself, which does nothing. Remove. BRANCH=none BUG=none TEST=builds Change-Id: I6b87a801a1ba09400b7c582dab66dec62b096e5b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1762534
* common: change clksrc_high to use STATIC_IF_NOTJack Rosenthal2019-08-201-10/+2
| | | | | | | | | | | | | | | This is an example of using STATIC_IF_NOT to assert a config option when a variable wil go unused. BUG=chromium:989786 BRANCH=none TEST=buildall Change-Id: I727505a26580506c04b26888030924253bb5fb2f Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1733017 Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* cleanup: use STATIC_IF for hibernate variablesJack Rosenthal2019-08-201-12/+14
| | | | | | | | | | | | | | | | This is an example usage of STATIC_IF, as a child CL of the STATIC_IF implementation. BUG=chromium:989786 BRANCH=none TEST=buildall Change-Id: I1e69bf85a3daf8aa5f5c0e0b1da9808a8a5f8649 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1731972 Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Raul E Rangel <rrangel@chromium.org>
* common: add STATIC_IF and STATIC_IF_NOT macrosJack Rosenthal2019-08-207-20/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common pattern to use with IS_ENABLED is like this: /* * This var should only be used if CONFIG_FOO. The linker errors if * CONFIG_FOO is not defined is intentional. */ #ifdef CONFIG_FOO static #else extern #endif int some_var; The issue with this is that it leads to an over-verbose and potentially hard to read pattern, and does not have the check that CONFIG_FOO was only defined to blank. Suppose a macro like this existed: STATIC_IF(CONFIG_FOO) int some_var; ... which expands to "static" when CONFIG_FOO is defined to empty, "extern" when CONFIG_FOO is not defined, and errors when CONFIG_FOO is defined to non-empty. This CL implements that, as well as the inverse (STATIC_IF_NOT). BUG=chromium:989786 BRANCH=none TEST=provided unit tests, buildall Change-Id: Ib57aaba62bc184fda9aa782a780d5f13ba44ae88 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1731859 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Volteer: add I2C bus configurationKeith Short2019-08-203-0/+83
| | | | | | | | | | | | | Configure I2C pins and i2c_ports for Volteer BUG=none BRANCH=none TEST=make BOARD=volteer, make buildall Change-Id: I3834a18a94565566b839d1e34befb180a366177c Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1758534 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Volteer: Add initial AP signalsKeith Short2019-08-205-2/+28
| | | | | | | | | | | | | | Enable ESPI interface and support for IceLake chipset. Configure reset and power button signals. BUG=none BRANCH=none TEST=make BOARD=volteer Change-Id: I6f06a71fc2516781fe3c23b997310a960e6e0bb8 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1758533 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* flapjack: tcs3400: add channel offsets and coefficientsNick Vaccaro2019-08-202-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | - adds channel offsets - adds channel coeefficients for use in xyz translation - enables LUX table use in anti-saturation algorithm These values are from the "Color Sensor Calibration to Compensate Cover Window Induced Error" document. BUG=b:124512628 BRANCH=master TEST=Flash and boot flapjack, verify that ALS and RGB sensors are still generating data. I used alslog patch and enabled saturation logging in EC console via "alslog 8". Verified LUX calculation had < 1% error (driver read 0.1% lower than a $3k LUX meter read). Verify that under a constant light source, the adjustment mechanism correctly drives the ALS values such that they land in the sweet spot between 90 to <100% of saturation. Cq-Depend: chromium:1633269 Change-Id: I88ec0e23f93aebb542823bccf27aade566074f2b Signed-off-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1665210
* IO Expander: add the interrupt support to IOEX frameworkCHLin2019-08-205-2/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL creates interfaces which bring the IOEX framework to support interrupt feature. To declare an IOEX IO which supports the interrupt function, file its declaration in gpio.inc with the format: IOEX_INT(name, expin, flags, signal) Note: like GPIO, all IOEX IOs with interrupt handlers must be declared at the top of the IOEX's declaration in the gpio.inc The following two APIs are added to enable/disable each IOEX IO's interrupt function: 1. ioex_enable_interrupt 2. ioex_disable_interrupt BRANCH=none BUG=none TEST=No error for "make buildall" TEST=Apply this and related CLs, manually test each IO pins; make sure each pin's interrupt handler is correctly executed. Change-Id: Icbf54c09120e37b68c647c884cd6aa28d9313167 Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1734947 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: CH Lin <chlin56@nuvoton.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* driver/tcs3400: improve efficiency of auto-adjustNick Vaccaro2019-08-203-16/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds an array which holds the number of atime increments needed at various lux levels and again settings to change delta from saturation by 1%. Using this table, the anti-saturation algorithm can get to the 90% band in most cases in a single adjustment vs the 10 to 15 adjustments previously needed when not using this table. Enabling CONFIG_TCS_USE_LUX_TABLES takes up 280 bytes in the ec.obj. BUG=b:124512628 BRANCH=master TEST=Flash and boot flapjack, verify that ALS and RGB sensors are still generating data. I used alslog patch and enabled ALS logging in EC console via "alslog 2047". Verify that under a constant light source, the adjustment mechanism correctly drives the ALS values such that they land in the sweet spot between 90 to <100% of saturation. Change-Id: I7cd0b8242e72233f50ff2751834f7bba367c6706 Signed-off-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1677764 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* tcs3400: update fields for als and rgb sensorNick Vaccaro2019-08-205-29/+107
| | | | | | | | | | | | | | | | Update board files for akemi, flapjack, hatch, kohaku, and kukui to use new field names in als_calibration_t and als_channel_scale_t. BUG=b:124512628 BRANCH=master TEST='make buildall' of the EC, verified builds succeed. Cq-Depend: chromium:1633269 Change-Id: I7ee324ce3de3377cd1538b631f4ec6294d2e9078 Signed-off-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1711958 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* driver/tcs3400: add auto-compensation for saturationNick Vaccaro2019-08-203-142/+455
| | | | | | | | | | | | | | | | | | | | | | | | | | Making settings more sensitive makes the SNR better, so this algorithm strives to keep the output level as close to 90% saturation as possible. Adds calibration mode and lux calculation. Removes unused last_value field from the tcs3400_rgb_drv_data_t structure, we use raw_xyz field in motion_sensor_t struct instead. BUG=b:124512628 BRANCH=master TEST=Flash and boot flapjack, verify that ALS and RGB sensors are still generating data. I used alslog patch and enabled ALS logging in EC console via "alslog 1023". Verify that under a constant light source, the adjustment mechanism correctly drives the ALS values such that they land in the sweet spot between 90 to <100% of saturation. Cq-Depend: chromium:1711958,chromium:1702543 Change-Id: Ibf260a990fe285cb54ee94c1ebe8aa85ea10affc Signed-off-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1633269 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* test: add baseline test for TC_DRP_TRYSRC SMJett Rink2019-08-205-9/+78
| | | | | | | | | | | | BRANCH=none BUG=none TEST=unit test pass Change-Id: I0ecb9f0298fd43ca0db800311a309d98eb1e29b5 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744658 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* test: add sanity check for existing state machinesJett Rink2019-08-2010-23/+398
| | | | | | | | | | | | | | | | | | | | We want to ensure that our usb state machines - do not have any cycles - do not have any completely empty states - have names for every print statement if called These new unit tests allow us to have build-times checks for the above. BRANCH=none BUG=none TEST=tests pass. Made each test fail locally to ensure that tests were actually working. Change-Id: Idd2c4d69e83cf38c97278edd1727d86b52a85db9 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744657 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* test: test nested entry/run calls to set_stateJett Rink2019-08-201-14/+93
| | | | | | | | | | | | | | | Ensure that a call to set_state will stop the chain of entry or run calls in parent/child states. BRANCH=none BUG=none TEST=run unit test Change-Id: I38a6eefeb728403503fee5455ed3ec065747a760 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744656 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* usb: update state machine frameworkJett Rink2019-08-2020-2917/+2221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - OBJ is renamed to context (CTX) for current and last state - State definition now includes its parent (no need for the boiler plate function that takes in a signal) - The init_state, set_state, and exe_state have been re-written to take advantages of new state machine definition. I had to add more logic to handle hierarchical states fully. - Explicitly create the USB states at the bottom of the file with all of the statics. Don't need to use macros (even though I did suggest them) - Use NULL when we do_nothing instead of calling into a function - Created a "private" enum in the C file that lists all of the states in the file, that we can use to refer to a state (it is also the index into the states array for that state). - Changed prototype of state function to return void, since we aren't really using the return value and it cleans up a lot of return 0 that aren't needed. - Add const to int port since we can and should - Moves struct definition to implementation file only to keep implementation details private. We can access data through accessor if needed. BRANCH=none BUG=none TEST=all unit tests passes Change-Id: I482a63e08f7d63022d5102b891a2fac0b0faa46f Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1733744 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Trembyle: Make GPIO names match schematicEdward Hill2019-08-205-58/+79
| | | | | | | | | | | | | BUG=none BRANCH=none TEST=make BOARD=trembyle Change-Id: I870bb384e59468c91ad19ebfbdf6d376438ae7ba Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1755648 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* Trembyle: update usb_pd_policyDenis Brockus2019-08-201-15/+28
| | | | | | | | | | | | | | | | | | Update some of the latest usb_pd_policy fixes that did not migrate to the code base used for trembyle https://crrev.com/c/1450815 https://crrev.com/c/1585121 https://crrev.com/c/1742870 BUG=b:139351980 BRANCH=none TEST=make buildall -j Change-Id: I536c1c19acaf72c66ca2ed3e6729a88f3f524344 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1754583 Reviewed-by: Edward Hill <ecgh@chromium.org>
* Volteer: initial EC board setupKeith Short2019-08-208-0/+217
| | | | | | | | | | | | | | | | Create Volteer skeleton build. Only includes base NPCX7 configuration required to build. BUG=none BRANCH=none TEST=make BOARD=volteer, make buildall TEST=Booted skeleton volteer EC image on careena board. Change-Id: I07769edfac9818320f18bbc9d0ebcd8f345fb8bb Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1758532 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* usb: state machines will resume immediatelyJett Rink2019-08-192-18/+17
| | | | | | | | | | | | | | Instead of waiting for one iteration to resume when we enable it, restart the state machine immediately BRANCH=none BUG=none TEST=build and units tests Change-Id: I6e1d1b281798ad8bd67fb552d4e2c2b36859a7f9 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1733743 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* usb: remove state transitions in exitJett Rink2019-08-192-2/+0
| | | | | | | | | | | | | | | If we transition to a new state in exit, then the original state we are transitioning to is lost. The new state machine common code will warn in this scenario. BRANCH=none BUG=none TEST=builds Change-Id: I571ff62dd6969bd3743cf33ae5c56dc02ae59724 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1733742 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* usb: de-dup common code from old and new PD stackJett Rink2019-08-1914-153/+147
| | | | | | | | | | | | | | We still need to pull out more common code between the two stacks, but this is scaffolding with a few examples. BRANCH=none BUG=b:137493121 TEST=unit tests pass Change-Id: Ibd9dda1e544e06f02aa3dde48ca7de1539700cfa Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744655 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* common: Prepare always_memset()stabilize-kernelnext-broadwell-12434.BYicheng Li2019-08-174-0/+26
| | | | | | | | | | | | | | Add a config for using always_memset() from third_party/cryptoc BRANCH=nocturne BUG=chromium:968809,chromium:989594,b:130238794 TEST=make -j buildall Change-Id: I22c83512eb1b8bdc8dac1b26315d25b65831513c Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1731543 Reviewed-by: Nicolas Norvez <norvez@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* docs: Add logo and change "Sitemap" to "Documentation"Tom Hughes2019-08-161-1/+2
| | | | | | | | | | | | | | | | | | The logo makes the docs consistent with other Chromium documentation: https://chromium.googlesource.com/chromiumos/docs/+/master/developer_guide.md I think that Using "Documentation" instead of "Sitemap" in the navbar makes it a little more obvious that clicking on that brings you to the index of all EC documentation. BRANCH=none BUG=none TEST=View in gitiles Change-Id: Iefacc1c1f7565061951ca78950313bc29f40ff9f Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741304 Reviewed-by: Jett Rink <jettrink@chromium.org>
* kodama: Add ACCEL and GYRO sensor LSM6DS3TR-C driverxiong.huang2019-08-163-26/+23
| | | | | | | | | | | | | | | | | | Kodama project uses chip LSM6DS3TR-C instead of BMI160, and modify its driver information to support LSM6DS3TR-C well. BUG=b:136977971 BRANCH=master TEST=1) At EC RW stage, accel and gyro init successfully. 2) It can get accel sensor XYZ datas with command 'ectool motionsense' in VT2. Cq-Depend:chromium:1730377 Change-Id: I32d5fb7ea1b305e42e1e5bbe9e1f22c9e6220abd Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1736408 Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* kodama: Support smart batterystabilize-12428.Bxiong.huang2019-08-166-17/+121
| | | | | | | | | | | | | | | | | Provide SMP and Celxpert smart battery initial files. BUG=b:136977971, b:138826367 BRANCH=master TEST=boot ec, verify that ec console prints 'found batt:SMP' or 'found batt:Celxpert'. Cq-Depend:chromium:1730377 Change-Id: I607fc41c51e8b27acddefda4dcd2ea02a7597a0f Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1731211 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
* usb_pd: Get USB-C cable type informationAyushee2019-08-164-2/+19
| | | | | | | | | | | | | | | Added logic to share the USB-C cable type information in host command to configure the virtual mux of Intel SOC. BUG=b:129990370 BRANCH=None TEST=Verified on Intelrvp, able to get correct USB-C cable type information Change-Id: Iee7c274d318f59a482d21b8faa56610509fbdf8e Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1749560 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* usb_pd: Storing USB-C cable attributesAyushee2019-08-163-32/+371
| | | | | | | | | | | | | | | | | | | | | | Cable response VDO after a discovery Identity command with SOP' is being stored and also added a console command which print the information on the console according the cable revision. Since USB PD rev2.0, USB PD rev 3.0 for active cable and USB PD rev 3.0 for passive cable have different cable vdos, different decodings are added for each according to their respective specifications. BUG=b:129990370 BRANCH=none TEST=Verified on dragonegg, able to store the cable attributes. Change-Id: I59e60fe9c820d3d08138875092849345db603776 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1553898 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* usb_pd: Adding USB-C cable detectionAyushee2019-08-166-15/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a discover identity command is sent with a SOP prime packet, the cable plug of an emark cable responds with the cable attribute. Added a structure pd_cable that stores the cable type and and resetting it when the cable is disconnected. Also added console command that gives the type of cable connected. Host(DFP) Cable Port-Partner(UFP) -------------------------EXPLICIT CONTRACT------------------------ Discover Identity SOP -----------------------------> request | <------------------------- Discover Identity response Discover Identity SOP' ---------> request | (If Emark Cable) <------------ Discover Identity SOP' | response Store cable type | (If Non-Emark Cable) <-------------- No response | Discover SVID SOP request ------------------------------------> (Rest of the PD flow) BUG=b:129990370 BRANCH=none TEST=Verified on dragonegg, able to get cable response Change-Id: I2536cf24d58f7ee5ff462b34fc32f69d7a200d41 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1707851 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* strago: Disable console commands to save spaceVijay Hiremath2019-08-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Strago is running out of space for additional changes in the common code hence disabled CONFIG_CMD_ACCELSPOOF console command to save space. Before: section `.data' will not fit in region `FLASH' No room left in the flash region `FLASH' overflowed by 52 bytes After: 204 bytes in flash and 1836 bytes in RAM still available on strago RO 592 bytes in flash and 1836 bytes in RAM still available on strago RW BUG=none BRANCH=none TEST=make buildall -j Change-Id: I208f6929518136e462ba79b74ea147f11516d6f2 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753693 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* hammer: Add magnemite boardNicolas Boichat2019-08-167-1/+36
| | | | | | | | | | | | | | | A close hammer derivative. BRANCH=none BUG=b:138968914 TEST=make BOARD=magnemite -j Flash into staff, see the board boot: util/flash_ec --board=magnemite --port=9000 Change-Id: Ibe5c3f4b0fb4a31d4667d5dc4d76a691b0e64e39 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741599 Reviewed-by: Yilun Lin <yllin@chromium.org>
* acpi: Notify AP when setting DPTF profile numberPhilip Chen2019-08-161-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assuming a device without hall sensor is switched from clamshell mode all the way to 360-degree-flipped mode, the event sequence is like: (a) When the device hits 200-degree, it switches to tablet mode. (b) We notify AP to re-read DPTF profile from ACPI. (c) When the device hits 300-degree, it switches to 360-degree flipped mode and updates DPTF profile in EC space. Since the DPTF profile is switched in (c) while AP re-reads the DPTF profile in (b), AP wouldn't update DPTF profile for 360-degree-flipped mode. To fix this issue, let's notify AP when updating DPTF profile. BUG=b:139168228 BRANCH=none TEST=manually test on Nautilus/Hatch and confirm trip temperature is updated in flipped-360-degree mode Change-Id: I3bc61fb3d7808bf17f7da7ebc606307fbbf026fc Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1747166 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* util: make flash_ec tolerant with dummy npcx_uut chipNamyoon Woo2019-08-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | flash_ec fails when npcx_uut chip in a bad status doesn't respond at all, especially upon ec_flash_size query. This patch subpress the exit on ec_flash_size query failure, because that information is not mandatory in flashing EC. BUG=none BRANCH=none TEST=manualy tested on kohaku. 1. programmed kohaku EC with a wrong binary. 2. checked kohaku EC in a bad status, and was not able to respond. 3. ran flash_ec and checked flash_ec finished EC FW program. e.g. flash_ec --board kohaku --image ${IMG} 4. read EC firmware back. e.g. flash_ec --board kohaku --read ${TMP_IMG} Change-Id: Ic853dd9f827217621cd598c799c68fbbf970078a Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753009 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* tglrvp_ite: Add TGL-U/Y RVP base codeDaniel Gonzalez2019-08-1513-17/+514
| | | | | | | | | | | | | | | | | | | | | | Added TGL-U/Y RVP base code using ITE EC. Following features are enabled. 1. TCPC + retimer 2. Charger 3. Battery 4. Power sequencing 5. Host communication 6. LED 7. Keyboard BUG=b:138597987 BRANCH=none TEST=Both TGLRVP U&Y can boot to ChromeOS Change-Id: Idf6be38796c26b31be6e13485a63ec13487bf954 Signed-off-by: Daniel Gonzalez <daniel.d.gonzalez@intel.com> Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1726943 Reviewed-by: Keith Short <keithshort@chromium.org>
* test: Update TEST_EQ to using string format specifierYuval Peress2019-08-152-166/+166
| | | | | | | | | | | BRANCH=None BUG=None TEST=builds and all tests pass Change-Id: Idbb288d8f422b4c01fe27c989bdf1188df509a27 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1752204 Reviewed-by: Jett Rink <jettrink@chromium.org>
* docs: Add fingerprint docs for partnersTom Hughes2019-08-1512-0/+440
| | | | | | | | | | | BRANCH=none BUG=none TEST=View in gitiles Change-Id: Ie1dc7ea93f3471dd10863e546b4a9dc001e7f3c1 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1742878 Reviewed-by: Nicolas Norvez <norvez@chromium.org>
* Fleex: add grabbiter EMR SKU ID(grob360s)Samsp_Liu2019-08-151-1/+2
| | | | | | | | | | | | | | | | | Add grabbiter EMR model with appropriate sku id value. BRANCH=octopus BUG=b:137628651 TEST=build and check can be recognize the sku id by ectools CBI and motionsensor can be worked. Change-Id: I1e2452db452e8ef0eaaf92d82b6f308dc045ea90 Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753567 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Marco Chen <marcochen@chromium.org> Tested-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Commit-Queue: Marco Chen <marcochen@chromium.org>
* kukui: enable CONFIG_CHARGER_MT6370_BC12_GPIOTing Shen2019-08-152-0/+6
| | | | | | | | | | | | | | | Apply the new option in CL:1575050 to Kukui devices with MT6370. TEST=Verify that krane is able to detect BC12 DCP. BUG=b:122866184 BRANCH=None Change-Id: I18f17af3672a364952779dcc2ee19b05b0459e20 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753566 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* kodama: Redefine battery and power led behaviorxiong.huang2019-08-152-96/+105
| | | | | | | | | | | | | | | | Redefine battery and power led behavior instead of RGB tricolour led. BUG=b:136977971 BRANCH=master TEST=1)Reach battery and power led SPEC requirement. 2)Command "ectool led power/battery **" can control led in VT2. Cq-Depend:chromium:1730377 Change-Id: I10a4f3a62f46f961b1742e9b7890e943c090995c Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1734952 Reviewed-by: Yilun Lin <yllin@chromium.org> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
* Trembyle: enable external 32K crystal oscDenis Brockus2019-08-141-0/+3
| | | | | | | | | | | | BUG=b:138601174 BRANCH=none TEST=make buildall -j Change-Id: Ic2b285a0d1c1f4a43b62bee3db760fedae3bfe6f Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1752599 Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* charge_manager: Mark functions overridableDaisuke Nojiri2019-08-146-20/+13
| | | | | | | | | | | | | | | | | | | Functions such as board_fill_source_power_info are overridable. This patch annotates them properly using override macros, and removes their declarations from board.h. These functions are declared in both charge_manager.h and {kukui,krane,kodama}/board.h. The latter causes comm-dev.c to fail to be compiled in chrome-base/diagnostics. BUG=none BRANCH=none TEST=buildall Change-Id: I27d6dfe2fa9299550ac5205c34095a4fe02dabdb Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1752597 Tested-by: Yu-Ping Wu <yupingso@chromium.org>
* kodama: remove DEVICE_TYPE_DOCKxiong.huang2019-08-143-37/+2
| | | | | | | | | | | | | | | | | Kodama removes BC1.2 in pogo port and only support dock keyboard. BUG=b:136977971 BRANCH=master TEST=1)Pogo detect pin level is changed with dock keyboard plugged in or out 2)Can get expected chars when type keys. Change-Id: Ib322f4aaa7174c3459d06633202e4c38ba6d6888 Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1736410 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Lu Zhang <lu.zhang@bitland.corp-partner.google.com> Tested-by: Lu Zhang <lu.zhang@bitland.corp-partner.google.com>
* flash_ec: support "--read" and "--verify" flags for npcx_uutNamyoon Woo2019-08-141-23/+74
| | | | | | | | | | | | | | | | | | | | | | This patch enables flash_ec to read EC image from npcx_uut type chip, and to verify the flash programmed image. BUG=b:133265593 BRANCH=none TEST=manually ran flash_ec on fleex and careena. flash_ec --board flex --image ${IMG} --verify flash_ec --board flex --read ${TMP_IMG} flash_ec --board careena --image ${IMG} --verify flash_ec --board careena --read ${TMP_IMG} Cq-Depend: chromium:1748803 Change-Id: Ifaefa64b0efed6c875c99ede59a3a1e0dfe0bf7f Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1749554 Reviewed-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Raul E Rangel <rrangel@chromium.org>
* Trembyle: Add chipset_handle_espi_reset_assert codeDenis Brockus2019-08-141-7/+19
| | | | | | | | | | | | | | | Added code for chipset_handle_espi_reset_assert. Fixed a couple #ifdef conditions using IS_ENABLED BUG=b:138600676 BRANCH=none TEST=make buildall -j Change-Id: I937ba3522d268b9151a4ed5134425e8b6a03796a Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1750801 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* kodama: Add usb mux IT5205 driverxiong.huang2019-08-143-3/+8
| | | | | | | | | | | | | | | Add usb mux IT5205 driver which helps Type-C DP display normally. IT6505 and FUSB42 keep in one direction, IT5205 control flipping. BUG=b:136977971, b:138686359 BRANCH=master TEST=HDMI in dongle display normally with positive and negative insertion. Cq-Depend:chromium:1730377 Change-Id: Icb587480d0a49f4f3f16e5367da5682f6627f3da Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741595 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* kodama: Remove unused chip driversxiong.huang2019-08-143-205/+13
| | | | | | | | | | | | | | | Kodama doesn't use tcs3400, bmm150 and pi3usb9201 chips. It needs remove ALS, RGB, MAG and BC1.2 drivers. BUG=b:136977971 BRANCH=master TEST=build and deploy on kodama, AP can boot. Change-Id: I43d97b4d1848fcd4513ec4de8202b9b889a08249 Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1730377 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
* ps8xxx: disable DCI modeCaveh Jalali2019-08-144-22/+110
| | | | | | | | | | | | | | | | | | | | DCI mode is auto-enabled by default. we don't actually support DCI (intel specific SoC debug path), so we can explicitly disable DCI mode. doing so, saves about 40mW on the 3.3v rail when USB2 devices or USB-C to USB-A dongles are left plugged in. this is particulary relevant in sleep mode as this accounts for a significant portion of the system power consumption. BUG=b:119875949 BRANCH=none TEST=verified power consumption drops using sweetberry, USB devices still functional across suspend/resume. Change-Id: Id13630425c78965d2ac4f2e97715374ae0640d23 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1732231 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Caveh Jalali <caveh@google.com>
* usb_mux: Send DP safe mode info to virtual MUXVijay Hiremath2019-08-144-2/+8
| | | | | | | | | | | | | | | | | Before entering into alternate mode, state of the USB-C MUX needs to be in safe mode so that the USB-C pins cab be re-purposed without getting damaged or do not damage their Port Partner. Hence, sending the DP safe mode info to virtual MUX from EC. BUG=b:139140865 BRANCH=none TEST=Manually tested on Intel RVP, MUX is able to configure to safe mode before entering alternate mode. Change-Id: I3715b5118112b7744407ac5e652f63f6d7cd0a1b Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1745540 Reviewed-by: Keith Short <keithshort@chromium.org>
* octopus: reduce USB-C source current to 1.5Alu.zhang2019-08-131-1/+0
| | | | | | | | | | | | | | | | octopus hardware does not support sourcing 3A over USB-C and 1.5A over USB-A at the same time for any daughter board. Reduce what we advertise to 1.5A. BRANCH=none BUG=b:139110010,b:139201733 TEST=connect a sink device with a pd analyzer to see if source capabilities is 5V/1.5A Change-Id: Idad7a11b28cefda1aabbca540864a6248d826a47 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741597 Reviewed-by: Edward Hill <ecgh@chromium.org>