summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* ioexpander: Add support to read levels on whole IOEX portMichał Barnaś2021-02-233-0/+36
| | | | | | | | | | | | | | | | In some cases it's needed to read many pins on the same IOEX port. To improve performance and remove redundant calls, it will be easier to read levels on whole IOEX port. To enable this functionality, CONFIG_IO_EXPANDER_SUPPORT_GET_PORT must be defined and driver must support it. BUG=b:168385201 BRANCH=main Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: I472385a4ef4f5db23ce92d017194f8c737b7607e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2700295 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: zmake: drop support for zephyr v2.4Jack Rosenthal2021-02-2315-14/+11
| | | | | | | | | | | | | | | | | | | Drop support for Zephyr OS v2.4 on all boards, since the v2.5 uprev is successful. If someone still needs to manually compile for v2.4 for testing, one can do so by passing --zephyr-base=$PATH_TO_ZEPHYR_24 and --ignore-unsupported-zephyr-version to zmake. BUG=b:180409973 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I0b3922c0b7f47811b26bad4e7f99125cabdaed91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2715345 Commit-Queue: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* lantis: Remove CONFIG_SYSTEM_UNLOCKEDTommy Chung2021-02-231-3/+0
| | | | | | | | | | | | | | | | | Lantis has progressed enough in development that we no longer need to force an unlocked state on the EC. BUG=b:180982041 BRANCH=dedede TEST=make -j buildall Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Ia63c5e072e2e4e0e7112c58a3fff756ce7634928 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2712219 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* guybrush: Enable debug configsRob Barnes2021-02-231-1/+4
| | | | | | | | | | | | | Enable debug configs to help with debugging. BUG=b:180941655 TEST=Build BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I509e1fdb585ab9ae871ac2f30216547bffeaa743 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2713424 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Add ANX7451 mux/retimer driverRob Barnes2021-02-235-1/+137
| | | | | | | | | | | | | | Add basic support for ANX7451. Datasheets available in bug. Support for tuning can be added later if needed. BUG=b:179065240 BRANCH=None TEST=Build Change-Id: Ifafdec4412b73b0fd3f7de2131a8617bbfde6426 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2699667 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: add PD console command supportFabio Baltieri2021-02-233-0/+19
| | | | | | | | | | | | | | | This adds support for actually building the code for "ec" and "pdcable" commands. The matching config were enabled, but the file was left out of the build. BRANCH=none BUG=b:177604307 TEST=tested the commands on volteer Change-Id: I996f4a4ab99f8ed36b090c8b7ffa3d8d0bee63dc Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2712968 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: flag CONFIG_STACK_SIZE as ECOS specificFabio Baltieri2021-02-231-0/+1
| | | | | | | | | | | | | | This is used in core/ specific architecture code, makes no sense for Zephyr, add it to the list of configs we don't care about. BRANCH=none BUG=b:177604307 TEST=build and run Change-Id: I9a4da34fb5a01c0bd96531b673b8b43038d0dcfa Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2712966 Reviewed-by: Simon Glass <sjg@chromium.org>
* baseboard/kukui: add support for EC variantDino Li2021-02-2314-0/+31
| | | | | | | | | | | | | | | With this change, we are able to build baseboard/kukui/baseboard.c on other chips. BUG=none BRANCH=none TEST=buildall. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I209daaa991f021fb7c33c21c28a7be30203510bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2710131 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* it83xx/gpg1 reset EC: save panic data to bramDino Li2021-02-232-1/+57
| | | | | | | | | | | | | | | | | This change saves panic data to bram before EC reset is triggered if GPG1 reset mechanism is enabled. Because the reset will also clear RAM contents. With this change, we can restore panic data from bram after panic reboot. BUG=b:173075595 BRANCH=none TEST=crash EC and then run the panicinfo command to check if panic data is saved. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I08f006c7969bce711695459b9f595ccc2fd6900b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2632123 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* Metaknight: Remove CONFIG_SYSTEM_UNLOCKEDYu-An Chen2021-02-231-5/+0
| | | | | | | | | | | | | | | Progressed enough in development that we no longer need to force an unlocked state on the EC. BRANCH=dedede BUG=b:179635951 TEST=make BOARD=metaknight Signed-off-by: yu-an.chen@quanta.corp-partner.google.com Change-Id: I4a0ba1a966f84b7b126c6553f6938d209565a7d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2706662 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* gitlab: Finish the script so it builds volteerSimon Glass2021-02-231-6/+21
| | | | | | | | | | | | | | Add a few more pieces to the script so that it checks out the required code and builds for volteer, using the zephyr toolchain. BRANCH=none BUG=b:178731498 TEST=simon, can you test and mark V+1? I have no idea how to run this Change-Id: I31de106a7c8d208c71e9e49378eeb85030ecc7fb Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697126
* zephyr: disable CONFIG_CORTEX_M_SYSTICKKeith Short2021-02-233-5/+0
| | | | | | | | | | | | | | | | The CONFIG_CORTEX_M_SYSTICK option cannot be used with the Nuvoton kernel timer support. BUG=b:177904393 BRANCH=none TEST=zmake testall Cq-Depend: chromium:2713759 Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I30f1c1a2c00319e8f787f4b98bc164fc43125165 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2714262 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* galtic: Update EC thermal tableJacky Wang2021-02-231-0/+34
| | | | | | | | | | | | | | Update EC thermal table for throttle and shutdown point. BUG=b:177628854 BRANCH=firmware-dedede-13606.B TEST=make BOARD=galtic 1. Verified pass by thermal team. Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: Icaaad93cdf933f5351cda7192e4b14c90f326d35 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2710129 Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMv2: Don't check VBUS when entering BIST modeAbe Levkoy2021-02-232-95/+0
| | | | | | | | | | | | | | | | | Temporarily remove check for VBUS = vSafe5V when entering BIST mode. It does this by measuring VBUS, but this facility is inadequate to the purpose on Volteer. Since this even more of an edge case than actually running BIST tests, remove the check for now, pending a more general solution. BUG=b:180957710,b:173023378 TEST=make buildall; pass TDA.2.1.2.2 BMC PHY RX INT REJ on voxel BRANCH=firmware-volteer-13672.B-main Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I172c1bcc10731c2e405344cdc6ad2b5a1ed80ced Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2714203 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: zmake: prune modules to only those required by the projectJack Rosenthal2021-02-233-0/+89
| | | | | | | | | | | | | | | | | | | | | Implement a new configuration option: "modules", which allows projects to require only specific modules. This is needed for chameleon so they can only require the modules they need (instead of all modules supported by zmake). From pfagerburg@: When zmake pulled in one of the EC modules, that module wanted a bunch of EC symbols to be defined in Chameleon's Kconfig, e.g., CROS_EC_RO and CROS_EC_RW. BUG=b:180545676 BRANCH=none TEST=provided unit test Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17bf2ac9a8f75f2879e5a67b991fd60d77071c32 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702509 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: implement --modules-dir parameterJack Rosenthal2021-02-234-14/+88
| | | | | | | | | | | | | | | | | | | Implement a parameter --modules-dir parameter, which lets the user create a flat directory, with each Zephyr module named appropriately as a subdirectory. This allows Zmake to be used without a Chrome OS source tree if both --modules-dir and --zephyr-base are provided. BUG=b:179813084 BRANCH=none TEST=unit tests TEST=gitlab CI Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ibedd1721bcc3f4dc6bae9e9b19d548e82297fa2a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702507 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: npcx: add system reset driverWealian Liao2021-02-223-5/+125
| | | | | | | | | | | | | | | | | | This CL include the following: 1. Add cros_system_soc_reset() API for system reset. 2. Add NPCX soc reset driver. NPCX chip doesn't have the specific system reset functionality. Use watchdog reset as the system reset. BUG=b:176523207 BRANCH=None. TEST=reset EC by 'reboot' console command Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Ia86bfac548ef48e18e501a29f3cbb632f33a3e8a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2698739 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* zephyr: volteer Kohaku: enable watchdogWealian Liao2021-02-222-0/+12
| | | | | | | | | | | | | | | | Enable watchdog on Volteer & kohaku. BUG=b:176523207, b:177604307 BRANCH=None. TEST=Trigger watchdog by 'waitms 2000' && don't trigger watchdog by 'waitms 1000' on volteer. Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I59a2031c14725ac8f9ae294e1a5cbfae84ebdab6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2706666 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* zephyr: change the hook task priorityWealian Liao2021-02-221-3/+3
| | | | | | | | | | | | | | | | | Chromium uses hook task to feed the watchdog. A watchdog will trigger if a task runs for too long. Change the priority of hook task to lowest. BUG=b:176523207 BRANCH=None. TEST=trigger watchdog by 'waitms 15000' Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I8030174b9824658d53f0bc3010b9da4ee0ef1f67 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2706665 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* zephyr: add watchdogWealian Liao2021-02-226-1/+135
| | | | | | | | | | | | | | | | | | | In npcx7 series, the Timer and Watchdog module (TWD) generates the clocks and interrupts used for timing periodic functions in the system. It also provides watchdog reset signal generation in response to a failure detection. This CL enables the watchdog functionality in zephyr system. BUG=b:176523207, b:177604307 BRANCH=None. TEST=add stall function to check the system can reset by the watchdog Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Iee0312dd6132ce76e622178b3a666aa415bc735a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2659135 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* board: Remove HAS_TASK_MOTIONSENSE when always definedGwendal Grignou2021-02-2218-62/+2
| | | | | | | | | | | | | | | ifdef HAS_TASK_MOTIONSENSE is only necessary for board that may not have sensor. Only oak board may be compiled without the sensor stack. BUG=none BRANCH=none TEST=compile. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I7d8e4ff1a647e73251b91a185780025bfae78187 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2693915 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Revert "zephyr: disable zephyr v2.5 for volteer"Keith Short2021-02-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dfc6e111e897e66d92b11bcb267661b1c2a79651. Reason for revert: Increasing stack sizes fixes Zephyr EC on volteer Original change's description: > zephyr: disable zephyr v2.5 for volteer > > Things went wrong and we're crashing! > > *** Booting Zephyr OS build zephyr-v2.5.0-1-gb589786657f9 *** > Hello from a Chrome EC! > BOARD=volteer > ACTIVE_COPY=RO > [0.012300 CBI Reading board info] > ... > Fatal error: 0 > a1 = 0x10072AE9 > a2 = 0x200CA805 > a3 = 0x00000001 > a4 = 0x0000003A > ip = 0x80000000 > lr = 0x00000000 > pc = 0x100A1D5B > xpsr = 0x10072A00 > > Disable for now ... will keep probing on my volteer and try and revert > this CL. > > BUG=b:180409973 > BRANCH=none > TEST=compile for volteer, got kernel 2.4 > > Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> > Change-Id: If0542005c9479e95596d33bca432446c8ceac2b7 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705447 > Reviewed-by: Simon Glass <sjg@chromium.org> > Commit-Queue: Simon Glass <sjg@chromium.org> > Tested-by: Simon Glass <sjg@chromium.org> Bug: b:180409973 Change-Id: If75900b830834e042cd9b6a2f971cebb2c1c6cca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2713555 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Keith Short <keithshort@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* volteer: Increase Zephry stack sizesKeith Short2021-02-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase the CHG_RAMP, KEYPROTO, and KEYSCAN stacks for Zephyr v2.5 support. Current stack usage with Zephyr v2.5: PD_INT_C1 (real size 1280): unused 1016 usage 264 / 1280 (20 %) PD_INT_C0 (real size 1280): unused 1016 usage 264 / 1280 (20 %) PD_C1 (real size 1024): unused 336 usage 688 / 1024 (67 %) PD_C0 (real size 1024): unused 400 usage 624 / 1024 (60 %) KEYSCAN (real size 768): unused 192 usage 576 / 768 (75 %) POWERBTN (real size 1024): unused 464 usage 560 / 1024 (54 %) KEYPROTO (real size 768): unused 200 usage 568 / 768 (73 %) HOSTCMD (real size 1024): unused 384 usage 640 / 1024 (62 %) HOOKS (real size 1024): unused 744 usage 280 / 1024 (27 %) MOTIONSENSE (real size 4096): unused 3448 usage 648 / 4096 (15 %) CHIPSET (real size 1024): unused 448 usage 576 / 1024 (56 %) CHARGER (real size 1024): unused 432 usage 592 / 1024 (57 %) USB_CHG_P1 (real size 1280): unused 848 usage 432 / 1280 (33 %) USB_CHG_P0 (real size 1280): unused 864 usage 416 / 1280 (32 %) CHG_RAMP (real size 768): unused 224 usage 544 / 768 (70 %) workqueue (real size 1024): unused 384 usage 640 / 1024 (62 %) shell_uart (real size 2048): unused 1080 usage 968 / 2048 (47 %) idle 00 (real size 320): unused 248 usage 72 / 320 (22 %) IRQ 00 (real size 2048): unused 1336 usage 712 / 2048 (34 %) BUG=b:180409973 BRANCH=none TEST=zmake testall TEST=Boot Zephyr EC on Volteer, verify AP boots. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I5208616bc798085079956f4642a918d83138ccac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2713557 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* adlrvp: cleanup: Move common files to baseboardVijay Hiremath2021-02-228-5/+7
| | | | | | | | | | | | | | | | | Moved the ADLRVP specific common files to baseboard so that the RVP variants with multiple MECC clients can leverage these files without copying them over to board files. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I19739a189aa29c198422f1e2013d59f5da97b02f Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2706259 Reviewed-by: Sooraj Govindan <sooraj.govindan@intel.com> Reviewed-by: Poornima Tom <poornima.tom@intel.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Storo: Initial EC imageMike Lee2021-02-228-639/+328
| | | | | | | | | | | | | | | | Initial EC image for Storo BUG=b:173340493 BRANCH=dedede TEST=make BOARD=storo pass boot device successfully Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I1c82cc80f161cdbe8561b06606ec9f34ed094094 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2584202 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Virtual mux: Set disconnect latch flag only in s3/s0ixAyushee Shah2021-02-221-2/+4
| | | | | | | | | | | | | | | | | | | | | When the AP comes up after G3 and since the disconnect flag is set, EC sends disconnect info to the AP probe functions. But the DUT is still in low power mode thus the AP doesn't receive the current mux state hence enumeration of USB4/TBT device fails when hotplugged at G3. This CL ensures that disconnect flag is only set in chipset suspend states i.e. s3 and s0ix BUG=b:180377259 BRANCH=None TEST=Connected USB4 device connect in G3 and checked enumeration Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Change-Id: I6992c528c7c39bf604d4e305b362ef04bc3c100e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705561 Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com> Reviewed-by: Madhusudanarao Amara <madhusudanarao.amara@intel.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* fan: fix fanset console commandCaveh Jalali2021-02-221-8/+12
| | | | | | | | | | | | | | | | | | | This fixes how the fanset console command parses its arguments. The original parsing would use the fan number as the RPM/duty cycle percentage when two arguments were given on a single fan system. Two arguments are now always treated as (fan number, RPM/duty cycle). On a single fan system, the fan number may be omitted. Additional arguments are rejected. BRANCH=none BUG=none TEST=verified fanset console command controls fan Change-Id: Ia6094354cbbc99c8bfcdb9dd9f227f75dc34507a Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2689498 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* fan: fix fanduty console commandCaveh Jalali2021-02-221-8/+12
| | | | | | | | | | | | | | | | | | This fixes how the fanduty console command parses its arguments. The original parsing would use the fan number as the duty cycle percentage when two arguments were given on a single fan system. Two arguments are now always treated as (fan number, duty cycle). On a single fan system, the fan number may be omitted. Additional arguments are rejected. BRANCH=none BUG=none TEST=verified fanduty console command controls fan Change-Id: Ib7f0141e698d80957a6ac7b770602dcf049aafbc Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2689497 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* raa489000 : change VBUS_CURRENT_TARGETYongBeum.Ha2021-02-211-2/+2
| | | | | | | | | | | | | | | set VBUS_CURRENT_TARGET to promised value + iOvershoot to cover overshoot BUG=b:178064507 BRANCH=none TEST=make -j BOARD=sasuke Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I22b9e2df9389b6f047d1aecc3e03df8fba06dc2b Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2670605 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Henry Sun <henrysun@google.com>
* TCPMv2: Fix build issue when usbc is in RW bu not RO imageScott Collyer2021-02-201-3/+3
| | | | | | | | | | | | | | | | | | This CL fixes build issues encountered when usbc is only required to be in RW, but not in the RO image. BUG=b:167462264 BRANCH=None TEST=verfied that can build on quiche when usbc support is only in RW and not in the RO image. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I0704f53a5e0d21a7aa0fcbe32a5ac3efc8eee060 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2293239 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org>
* TCPMv2: Allow DFP ALT-DP mode without chipset taskScott Collyer2021-02-202-1/+5
| | | | | | | | | | | | | | | | | | This CL guards checks related to AP power state with a check for chipset task. This is required for boards which might still want to do ALT-DP mode, but do not have an AP, such as a type-c dock. BUG=b:175660576 BRANCH=None TEST=Verified on quiche that C1 port will enter alt-dp mode as DFP Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Iefd2254c2e8376fa061184b9fed7c5d79f65ce01 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677704 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org>
* TCPMv2: PE: Improvements for SVDM response handlerScott Collyer2021-02-201-73/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | This CL fixes/improves the follow areas: - Refactors the svdm_response entry state, including logic to set/clear the modal operation flag upon enter/exit mode. - Adds a check for tx message discarded flag in the response run state which allows a VDM command sequence to be proplerly interrupted. - Adds logic in the vdm common parser helper function to check for DP attention messages so the state doesn't wait for a reply. BUG=b:175660576,b:173027965 BRANCH=None TEST=Verified on quiche that can enter ALT-DP mode as a UFP-D and that display is extended properly via display port or hdmi connector. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I723f09ced39a3cd7c3d434102fad51c4c31f8d9f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677703 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org>
* metaknight: Remove C1 charger taskAseda Aboagye2021-02-201-1/+0
| | | | | | | | | | | | | | | | | | | | | Recently, metaknight was cleaned up to remove all C1 related items, but one thing was forgotten, the C1 USB charger task. This caused a watchdog reset to happen upon init with the new changes. This commit simply removes the C1 USB charger task from metaknight. BUG=b:180678923 BRANCH=dedede TEST=Build and flash metaknight, verify that DUT boots and does not watchdog reset. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I3280ee112858e057acb69619ac2072e362636dad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2708667 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* charge_manager: Notify PD if active charger can provide more powerPatryk Duda2021-02-191-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When multiple chargers are connected first connected charger will provide maximum power while others will remain at 5V. If the active charger is removed charge manager should send new power request to PD. CL:2592498 introduces bug which prevents charge manager from sending new power request to other charger if active charger is removed. This CL implements checking if active charger is providing as much power as possible. If more power can be provided charge manager will send new power request to PD. BUG=b:161775827 BRANCH=none TEST=Run firmware_PDVbusRequest FAFT test. TEST=Connect chargers to both USB-C ports. First connected charger should negotiate target voltage, while second charger should remain at 5V. Disconnect first charger and check if second charger negotiated higher voltage. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I2e53a572871dfcacf33d3024c2c2f017cfdca43e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2707105 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
* volteer: Enable button console commandMadhu M2021-02-192-0/+12
| | | | | | | | | | | | | | | | | | | | Enabled compiler switch for volteer board to simulate button operations. BUG=None BRANCH=None TEST=Tested on delbin/voxel board. From EC console, entered the below commands: $ button vup 1000 Observed volume UP key press on display $ button vdown 1000 Observed volume DOWN key press on display Signed-off-by: Madhu M <madhu.m@intel.corp-partner.google.com> Change-Id: I5ba3abfba25e29bbd96997c9321e3718b4b1c0bd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2686975 Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Madhu M <madhu.m@intel.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* servo_v4p1: Manage USB PWR and FAULT from ECJan Dabros2021-02-194-73/+8
| | | | | | | | | | | | | | | | Due to issues with GL3590 firmware it was decided to get back to EC managing USB POWER and FAULT signals via ioexpanders. BUG:b:169929627 BRANCH:main TEST:build firmware and flash servo_v4p1. Verify operation of all USB ports. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ia39462aa99502b8869735798c64164ac05403098 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2704546 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: Drop duplicate IS_BIT_SET()Simon Glass2021-02-191-0/+3
| | | | | | | | | | | | | | | This gives a warning about a duplicate definition since it is defined in Zephyr now. BUG=b:180409973 BRANCH=none TEST=warning is gone Change-Id: I6d7a7b5f344bf6ab4168a2dee062c9199175faf9 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705443 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Reland: asurada: set input voltage to 9V when S5 with full batteryTing Shen2021-02-191-0/+34
| | | | | | | | | | | | | | | | | | | | | | | (This relands CL:2470378 with an additional system unlocked check, original message below) The data in b:162467514#comment3 shows that 9V input has lowest power consumption in S5. This CL forces PD to select 9V when S5 with full battery. BUG=b:162467514 TEST=Verify dut chooses 9V when in S5 and battery full, and chooses 15V in other states. TEST=pass firmware_PDVbusRequest.shutdown BRANCH=none Change-Id: I8de113ccd40fc76aee2e4e4026ef213ec542cf3a Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705453 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* asurada_scp: enable DRAM cacheTzung-Bi Shih2021-02-192-0/+7
| | | | | | | | | | | | | | | SCP view 0x1000_0000 maps to AP view 0x5000_0000. Total size is 20MB. BRANCH=none BUG=b:156222459 TEST=make BOARD=asurada_scp Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I7357247d7621d098673890c75c26aa1b6e2d4b50 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2531755 Reviewed-by: tinghan shen <tinghan.shen@mediatek.com> Reviewed-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* core/riscv-rv32i: set in_interrupt at beginning of exception handlerTzung-Bi Shih2021-02-192-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 3 paths when receiving an excaption in core/riscv-rv32i/init.S: 1. __irq_handler 2. excep_handler 3. unhandled_interrupt Originally, in_interrupt_context() returns true only if it goes to 1st path. However, the rest paths are also in interrupt context, especially some function may rely on in_interrupt_context(), for example, uart_flush_output() in common/uart_buffering.c. Note that, only the 1st goes back to normal context. The rest of paths are all going to panic and reset. Sets in_interrupt at the beginning of exception handler instead of start_irq_handler() so that the flag is ON when receiving an exception. BRANCH=none BUG=b:180571536 BUG=b:163300760 TEST=make BOARD=asurada_scp Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: Iba689c506c02c4b5bb1668766f1d7ab5f86f72a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702999 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* zephyr: Drop use of DEVICE_AND_API_INIT() in drivers/cros*Simon Glass2021-02-194-16/+15
| | | | | | | | | | | | | This macro is deprecated in v2.5. Replace it with DEVICE_DEFINE(). BUG=b:180409973 BRANCH=none TEST=build for volteer and see the warnings are gone Change-Id: Ie790e89b2f9933db22776f536948541ee288716e Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705446 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Avoid duplicate CLAMP() macrosSimon Glass2021-02-191-0/+2
| | | | | | | | | | | | | | This defined in Zephyr's sys/util.h so we should not define it again when building for Zephyr. Add an #ifdef to fix this. BUG=b:180409973 BRANCH=none TEST=build and see there is no duplicate warning for CLAMP() Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I51cf1661b247adb423356f28a516967a80d1e064 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705445 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Fix uart_console_read_buffer_init() return valueSimon Glass2021-02-191-0/+2
| | | | | | | | | | | | | | This function should have a return value. Add it to avoid a warning. BUG=b:180409973 BRANCH=none TEST=warning is gone Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I70562e3f4ddea1283099f93939abd3faef0476e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705444 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* sasuke : tune retimer 0/1YongBeum.Ha2021-02-191-3/+87
| | | | | | | | | | | | | | | tune retimer to improve eDP signal BUG=b:176862264 BRANCH=None TEST=make -j BOARD=sasuke Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I57b62cc7f598d15478e837af508c59fa58c68d72 Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2684082 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* bq25710: Allow compilation with CHARGE_RAMP_SWCaveh Jalali2021-02-191-0/+2
| | | | | | | | | | | | | | | | The bq25710 driver supports compiling without CHARGE_RAMP_HW enabled, but the exluced functions are still referenced from the driver's struct charger_drv. So, make these references conditional on CHARGE_RAMP_HW as well. BRANCH=none BUG=b:173575131 TEST=buildall passes Change-Id: I8737c1eb465c82b5d004b778d7e80ba296742664 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2700312 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* brya: Fix USB DB I2C bus assignmentsCaveh Jalali2021-02-191-3/+3
| | | | | | | | | | | | | The USB daughterboard control chips are on I2C bus 6_1, not 6_0. BRANCH=none BUG=b:173575131 TEST=no more I2C errors when trying to access chips Change-Id: Ia542b42612a091a1bf85d1be4b6bd186b5f0bb91 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2704033 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* Coachz: Fix issue of resetting AP not initialize the states correctlyWai-Hong Tam2021-02-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | base_detect_change() and tablet_set_mode() skip doing anything if the state has no change. Originally, the S3->S5 hook sets the state to DISCONNECTED. The next startup S5->S3 may not initialize the state correctly if no change, e.g. the case: attach keyboard -> power-off -> detach keyboard -> power-on. It won't set the tablet mode and won't notify AP. We should set the state to UNKNOWN in the S3->S5 hook. The next startup will set the states correctly and notify AP. BRANCH=Trogdor BUG=b:179930342 TEST=Plug keyboard, power-off AP, unplug keyboard, power-on AP, plug keyboard, and checked the EC log that proper states are set and events are sent to AP. Change-Id: Ie6111f2ebbbde7ec6a9de2045a463d769ee6fb2b Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685409 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: disable zephyr v2.5 for volteerJack Rosenthal2021-02-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Things went wrong and we're crashing! *** Booting Zephyr OS build zephyr-v2.5.0-1-gb589786657f9 *** Hello from a Chrome EC! BOARD=volteer ACTIVE_COPY=RO [0.012300 CBI Reading board info] ... Fatal error: 0 a1 = 0x10072AE9 a2 = 0x200CA805 a3 = 0x00000001 a4 = 0x0000003A ip = 0x80000000 lr = 0x00000000 pc = 0x100A1D5B xpsr = 0x10072A00 Disable for now ... will keep probing on my volteer and try and revert this CL. BUG=b:180409973 BRANCH=none TEST=compile for volteer, got kernel 2.4 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: If0542005c9479e95596d33bca432446c8ceac2b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705447 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* Docs: Update source-out policy noteDiana Z2021-02-191-2/+3
| | | | | | | | | | | | | | Now that the full source-out policy has been implemented in the TCPMv2 DPM, modify the previous note about implementation. BRANCH=None BUG=b:141690755 TEST=view in Chrome with Markdown Preview Plus Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ic74c780841c42e1e1d88306d366a00bf0fadb3c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2701892 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Clarify how to opt out of DPM source-out policyDiana Z2021-02-191-0/+3
| | | | | | | | | | | | | | | | Add clarification for how a board can turn off the 3.0 A source-out policy. This can be either because it doesn't support sourcing that much current, or because it is implementing a board-specific PDO selection. BRANCH=None BUG=b:141690755 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I5a9d23c115470063a84170cf222845086d86955b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2701891 Reviewed-by: Keith Short <keithshort@chromium.org>