summaryrefslogtreecommitdiff
path: root/zephyr
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: add sleep property for keyboard factory testRuibin Chang2023-02-162-22/+26
| | | | | | | | | | | | | | | | | | | | Add sleep property for keyboard factory test. This CL depends on PR: https://github.com/zephyrproject-rtos/zephyr/pull/54641 BRANCH=none BUG=b:262352202 TEST=on yaviks, run "ectool kbfactorytest" when we intend to short the KSI/KSO pin, it would fail the test. And when finish the test, keyboard scan function can work. Change-Id: I6a9d1831a911e52d989b074be14797cda5375036 Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4223685 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* nissa: disable PLATFORM_EC_TCPC_INTERRUPTPeter Marheine2023-02-1518-63/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Because nissa shares a physical IRQ pin between BC1.2 and TCPC on type-C ports, using the shim interrupt handler can cause TCPC interrupts to be lost in some situations: 1. BC1.2 asserts IRQ 2. Type-C ISR runs, checks alerts and goes back to sleep (because no TCPC interrupts are pending). 3. TCPC asserts IRQ (which remains asserted because BC1.2 still has a pending interrupt). 4. BC1.2 task clears BC1.2 interrupt. 5. IRQ is stuck asserted because the TCPC interrupt task will only wake up on the next active IRQ edge. Port is broken. This change restores the custom shared IRQ handling for Nissa that adds polling to ensure IRQs cannot become permanently stuck. BUG=b:254148652,b:269212593 TEST=Sinking, sourcing and USB still work on Yaviks port C1 BRANCH=nissa Change-Id: Ie45ec82c68ce7ebc8693ea2ebab9a141e96edbab Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4252437 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: zhi cheng yuan <jasonyuan@chromium.org>
* zephyr: Add geralt to gitlab buildsTristan Honscheid2023-02-151-1/+9
| | | | | | | | | | | | | | | Start running builds for the geralt project in Gitlab and calculating code coverage. BUG=b:268215825 BRANCH=None TEST=None Change-Id: I699cf95e2ebe7e82b955c293dfc295705e2624d5 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4250848 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr/ps8xxx: fix build with TCPC_INTERRUPT disabledPeter Marheine2023-02-151-1/+7
| | | | | | | | | | | | | | | | The irq_gpio field only exists if CONFIG_PLATFORM_EC_TCPC_INTERRUPT is enabled, otherwise the equivalent is alert_signal. BUG=b:269212593,b:254148652 TEST=zmake build yaviks with CONFIG_PLATFORM_EC_TCPC_INTERRUPT=n BRANCH=nissa Change-Id: Ib2219e39eb81dcdb9f780b46a263b85adfbb6b15 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4252925 Reviewed-by: zhi cheng yuan <jasonyuan@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* tasks: Add task_id_to_thread_id and thread_id_to_task_idRob Barnes2023-02-158-14/+192
| | | | | | | | | | | | | | | | | | | Add thread_id_to_task_id and thread_id_to_task_id for mapping between Zephyer thread ids and EC task ids. This change allows for looking up threads without the need of CONFIG_THREAD_MONITOR which costs ~1.5KB of additional flash. Add new tests for checking the mapping between tasks and threads. BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: I9c7ef4d14248bfac5aede9f14adc302342fbe9a6 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214561 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: test: Test 'flashread' console commandTristan Honscheid2023-02-151-0/+42
| | | | | | | | | | | | | | Test the operation, edge cases, and output formatting of the `flashread` console command BUG=None BRANCH=None TEST=./twister -s drivers/drivers.flash Change-Id: Ic572b4a34ebbe0436142b1214449944175af29f3 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4224879 Reviewed-by: Tomasz Michalec <tmichalec@google.com>
* zephyr: test: Test 'flashwrite' console commandTristan Honscheid2023-02-151-0/+47
| | | | | | | | | | | | | Test operation and various edge conditions of `flashwrite`. BUG=None BRANCH=None TEST=./twister -v -i -c -s drivers/drivers.flash Change-Id: I02e90d020719b96c88c0a5b8ff1cb9bb83e853ca Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4224878 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* tasks: Add extra MAIN task idRob Barnes2023-02-157-25/+58
| | | | | | | | | | | | | | | | | | Add TASK_ID_MAIN as a non-shimmed extra task. This task is only present when CONFIG_TASK_HOSTCMD_THREAD_DEDICATED is enabled. Add get_hostcmd_thread and get_main_thread helper methods. The hostcmd thread will be the same as the main thread when CONFIG_TASK_HOSTCMD_THREAD_MAIN is enabled. BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: If61dca427686a9c3cf6fb05dc5ca4e5a87b47127 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214560 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* tasks: Add local get_syswork_thread methodRob Barnes2023-02-153-2/+10
| | | | | | | | | | | | | | | Add local get_sysworkq_thread method. Also add HAS_TASK_SYSWORKQ. This just cleansup the handling of the syswork task id. BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: Ic665d33aa524edd5ab9902e5591bfa4b1a5263b0 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214558 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* tasks: Add extra IDLE task idRob Barnes2023-02-154-2/+27
| | | | | | | | | | | | | Add the idle task to the non-shimmed extra tasks list. BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: I87cbbcd32777ab65de09c053a9098031f0950c3e Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214557 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr/test: Add extra_tasks testRob Barnes2023-02-154-4/+74
| | | | | | | | | | | | | | | | | Add a new extra_tasks test case. Instead of defining new test tasks, this case checks that the default extra tasks are created. The test fixtures are pretty bare at the moment. More tests will be filled when more functionality is added to shim/tasks.c BUG=b:267470086 BRANCH=None TEST=Unit tests Change-Id: I2cbd38a37770bec35aeb55da5c2ac279e0e2c09e Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4252003 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* yavikso: Update fan table version 3Devin Lu2023-02-151-11/+11
| | | | | | | | | | | | | BUG=b:253557900 BRANCH=none TEST=Thermal team verified thermal policy is expected. Change-Id: I7a47a1d4b5f41ba1591813d4727c3c55ebedb36f Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4247720 Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org> Tested-by: Devin Lu <devin.lu@quantatw.com> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org>
* geralt: fix ap_xhci_init_done interrupt flagEric Yilun Lin2023-02-151-1/+1
| | | | | | | | | | | | | | | | The flag has to be GPIO_INT_EDGE_BOTH. BUG=b:269059211 TEST=depthcharge detects usb devices BRANCH=none Change-Id: Iead411e3175c4dece70c98fa5aaef4d0ceff61c5 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4253128 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* frostflow: Disable EC_EEPROM_CBI_WPLogan_Liao2023-02-151-2/+0
| | | | | | | | | | | | | | | | | | Remove EC_EEPROM_CBI_WP. BUG=b:269213075 BRANCH=none TEST=zmake build frostflow success. Change-Id: I95a31f0695473aec5ca9761e80b75ba298dd9a1f Signed-off-by: Logan_Liao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4248859 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: SamSP Liu <samsp_liu2@compal.corp-partner.google.com> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* Zephyr: Remove default-on for retimer FW updateDiana Z2023-02-144-3/+2
| | | | | | | | | | | | | | | | | | The retimer FW update code is specifically written to support the Intel USB4 retimers. Most boards do not use these retimers, so remove the default-on for it and instead have the retimer presence select the update module to be included. BRANCH=None BUG=None TEST=CQ+1; build skyrim and observe almost 1k more free flash; zmake compare-builds passes for rex and herobrine Change-Id: I1c89bf18b31520a80c4f63a843142efdd5004dd0 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4249917 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: remove duplicated structure for npcx SHI driverMichał Barnaś2023-02-142-112/+27
| | | | | | | | | | | | | | | | | | | | | Revert "dts: Remove upstream SHI driver in favor of our own" This reverts commit 9a9669c83100f8833d066e8a0e58a561075c3e9f and removes the duplicates structure and defines that can now be used from the upstream Zephyr header files. BRANCH=main BUG=b:265763662 TEST=run the host commands test on affected boards LOW_COVERAGE_REASON=No tests are available for EC on-chip peripherals. Change-Id: Ibc26beae8476bf3cdd5cc83ccaa5b66ead99dc41 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4180587 Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Michał Barnaś <barnas@google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Michał Barnaś <barnas@google.com>
* zephyr: remove shi node and add references to shi0Michał Barnaś2023-02-1416-94/+22
| | | | | | | | | | | | | | | | | | | This commit removes the references to internal shi node in device tree and changes them to shi0 from the Zephyr device trees. Changes also the compatible string from internal to upstream one by removing the 'cros' prefix and removes the binding files. BRANCH=main BUG=b:265763662 TEST=run the host commands test on affected boards LOW_COVERAGE_REASON=No tests are available for EC on-chip peripherals. Change-Id: Iefdba23680d7734013de128f1b8878bac2c96cfa Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4180585 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Michał Barnaś <barnas@google.com> Tested-by: Michał Barnaś <barnas@google.com>
* Revert "zephyr: npcx: move npcx-cros-shi node to the bottom of dts"Michał Barnaś2023-02-144-39/+14
| | | | | | | | | | | | | | | | | This reverts commit 266693ffe32bf59aa91d7f021e08bdd5aa9773b0. The proper fix requires to revert this change. BRANCH=main BUG=b:265763662 TEST=run the host commands test on affected boards Cq-Depend: chromium:4180585 Change-Id: I3c9d036d72f9951479d7a745539c5dcef2b45516 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4180584 Tested-by: Michał Barnaś <barnas@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Michał Barnaś <barnas@google.com>
* zephyr: test: Test 'flasherase' console commandTristan Honscheid2023-02-142-17/+114
| | | | | | | | | | | | | | Test the operation of the `flasherase` console command and various edge cases BUG=None BRANCH=None TEST=./twister -v -i -c -s drivers/drivers.flash Change-Id: If81b82c5879e178c4d34c111eef61feed9be0904 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4224877 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* shim/panic: Fix CODE_UNREACHABLE when running testRob Barnes2023-02-143-3/+8
| | | | | | | | | | | | | | | | | | CODE_UNREACHABLE inisde k_sys_fatal_error_handler is disabled during tests. This was disabled because system_safe_mode needs to test returning from k_sys_fatal_error_handler. However this change will mask asserts in some cases. Switch to __ASSERT_UNREACHABLE which can be disabled on a per test basis. BUG=None BRANCH=None TEST=Unit tests Change-Id: I32e20a5358d85d059985c0cdf4a65ce37e454a80 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4246960 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Jeremy Bettis <jbettis@chromium.org>
* zephyr: firmware_builder.py: Run with Python 3.8Jack Rosenthal2023-02-141-1/+1
| | | | | | | | | | | | | | | | | The CL in the Cq-Depend changes the zmake package to be in Python 3.8 instead of 3.6. Since this script imports zmake, it must run with the same version. BUG=b:187794810 BRANCH=i don't care TEST=CQ Cq-Depend: chromium:4247612 Change-Id: Idbb64f130cb51332bef994d96830b69e96813b5c Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4247143 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* system_safe_mode: Publish EC_HOST_EVENT_PANIC when safe mode startsRob Barnes2023-02-141-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Publish EC_HOST_EVENT_PANIC when safe mode starts. The event is published from a deferred function since publishing events from an ISR is not compatible with some systems. The kernel may use this event to clean up before the system is reset (e.g. sync the drive). This will be a no-op if the kernel doesn't handle it. This is a refactor of CL:4063818, which was reverted in CL:4225911. The original implementation triggered the event in the panic handler. This version triggers the event after safe mode starts. Since the system reboots immediately when safe mode isn't started, triggering the event outside of safe mode doesn't have any effect. BUG=b:258195448 BRANCH=None TEST=Observe event in kernel. Pass system_safe_mode unit test. Change-Id: I62c48590029bf2bf8f1e0bb7271f29499a8a28d7 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4226407 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: Fix YAML files to conform with upstream styleTristan Honscheid2023-02-143-51/+52
| | | | | | | | | | | | | | | | | cl:4177231 enabled YAML file linting for platform/ec/zephyr files based on upstream Zephyr's style but several of our YAML files do not currently conform. This CL has all the required corrections when running the linter on every YAML file. BUG=None TEST=util/zephyr_check_compliance.py modified to scan everything BRANCH=None Change-Id: I9dcf1d7f0c306028e4d6b368f20e88c882514169 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4247159 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
* Craask: Charger limit for 65w adapterSue Chen2023-02-141-0/+5
| | | | | | | | | | | | | | | Craaskino and Craasula support 65W adapter. PD maximum power / current / voltage -> 65w / 3.25A / 20V BUG=b:268273712 BRANCH=nissa TEST=zmake build craask Change-Id: I31e030b7bf35314a94bed105fc022acd1ac22b8f Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4248858 Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org>
* geralt: disable bc1.2Ting Shen2023-02-145-10/+2
| | | | | | | | | | | | | | | | Remove CONFIG_USB_CHARGER and hide related driver code inside #ifdef. BUG=b:267989266 TEST=no USB_CHG task in `kernel thread` BRANCH=none LOW_COVERAGE_REASON=early bringup Change-Id: Iebd80267f64149fde148a436212c9998824c6564 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4248932 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* geralt: enable xhci interruptEric Yilun Lin2023-02-143-0/+59
| | | | | | | | | | | | | | | | | After AP initiates the XHCI HUB, the AP will raise the XHCI interrupt to EC, and EC has to recycle the VBUS of the USB ports. BUG=b:269059211 TEST=depthcharge detects usb devices BRANCH=none Change-Id: Ic57fc91b76f28af7fb5c1bafe1926a6dd02333ca Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4247784 Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com>
* zephyr: tentacruel: Increase PLATFORM_EC_I2C_NACK_RETRY_COUNTluluboy_Jian2023-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | After enable PLATFORM_EC_I2C_NACK_RETRY_COUNT configuration. It is still show charge problem: batt params, 0x0 -> 0x42 once. So follow previous kukui platform. The retry count is set to 10 times. BUG=b:238921417 BRANCH=none TEST=The error message:"charge problem: batt params" did not occur during the S3 stress test and frequent gpioget command testing. Change-Id: I1f7db82907c332b17845676d9759649a85223eb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4243820 Tested-by: Luluboy Jian <luluboy_jian@asus.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Luluboy Jian <luluboy_jian@asus.corp-partner.google.com>
* mt8188: add notes about mt8186 code reuseEric Yilun Lin2023-02-132-2/+4
| | | | | | | | | | | | | | | | | | | Add comments for indicating the reuse of the mt8186 code on mt8188 platform. BUG=b:267268982 TEST=zmake build BRANCH=none Change-Id: I026071eec35fa0bd999c1c1642f1c15065712a7f Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4243819 Auto-Submit: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Fei Shao <fshao@chromium.org> Reviewed-by: Fei Shao <fshao@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* microchip_xec: remove CROS_EC_RW_SIZE configurationDino Li2023-02-131-3/+1
| | | | | | | | | | | | | | | | | | This configuration is configured with binman's size property. BRANCH=none BUG=none TEST=build mtlrvpp_mchp. cat /generated/autoconf.h | grep CROS_EC_R #define CONFIG_CROS_EC_RO_MEM_OFF 0x0 #define CONFIG_CROS_EC_RO_SIZE 0x3F000 #define CONFIG_CROS_EC_RW_MEM_OFF 0x0 #define CONFIG_CROS_EC_RW_SIZE 0x40000 Change-Id: Ie169e6acfd6017fd6d12dcc08683d9b0eaf1bf42 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4223682 Reviewed-by: Keith Short <keithshort@chromium.org>
* it8xxx2: remove CROS_EC_RO_SIZE and CROS_EC_RW_SIZE configurationsDino Li2023-02-131-9/+2
| | | | | | | | | | | | | | | | | Both configurations are configured with binman's size property. BRANCH=none BUG=none TEST=cat /generated/autoconf.h | grep CROS_EC_R #define CONFIG_CROS_EC_RO_MEM_OFF 0x0 #define CONFIG_CROS_EC_RO_SIZE 0x60000 #define CONFIG_CROS_EC_RW_MEM_OFF 0x60000 #define CONFIG_CROS_EC_RW_SIZE 0x60000 Change-Id: Idaf9fe8668657e7751c86996cb59efc320f1c259 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4173174 Reviewed-by: Keith Short <keithshort@chromium.org>
* crystaldrift: add keyboad config for function keyTang Qijun2023-02-132-0/+30
| | | | | | | | | | | | | | | add keyboad config for function key. BRANCH=none BUG=b:268414730 TEST=test the function key is work normal Change-Id: I0231e8cbd5440b96f8b2f3536daa710a81c655c7 Signed-off-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4236859 Reviewed-by: Chao Gui <chaogui@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* winterhold: Modify thermal configLeila Lin2023-02-122-11/+11
| | | | | | | | | | | | | | | | | | Adjust fan tabel config to avoid the fan pulse on and off randomly when system power on. LOW_COVERAGE_REASON=no unit tests for skyrim yet, b/247151116 BRANCH=none BUG=b:268044663,b:255732503 TEST=verify the thermal config on winterhold is correct Change-Id: Ia2061b8c800a5d9f36fce4a2309d6c280b7bc55a Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4235045 Commit-Queue: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Tested-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com>
* zephyr: test: Update RTC driver testSam Hurst2023-02-111-2/+15
| | | | | | | | | | | | | | | | Update RTC driver test to compensate for the additional second added alarm time returned by system_get_rtc_sec(). BUG=b:261377404 BRANCH=None. TEST=twister -T zephyr/test/drivers Change-Id: I7bca42195bdbb066d214173972bc777960609641 Signed-off-by: Sam Hurst <shurst@.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4241078 Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Sam Hurst <shurst@google.com> Commit-Queue: Sam Hurst <shurst@google.com>
* zephyr: shim: Add 1 second to alarm settingSam Hurst2023-02-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | Adding 1 additional second to alarm setting because the system_get_rtc_sec() function returns the number of seconds truncated to the nearest integer. This results in missed alarms if, for example, the actualvalue is 7.99 seconds and 7 seconds is returned. BUG=b:261377404 BRANCH=None. TEST=check rtc_alarm 1 test_that ${DUT_IP} power_Resume Cq-Depend: 4241078 Change-Id: I1c07ecb8db6a3f6779c48d89cc39a2df12f92d7f Signed-off-by: Sam Hurst <shurst@.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4237580 Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Tested-by: Sam Hurst <shurst@google.com> Commit-Queue: Sam Hurst <shurst@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr/app/ec/chip/arm: Add memory layout definitionsPatryk Duda2023-02-111-0/+32
| | | | | | | | | | | | | | | | Introduce defines about memory layout for STM32 devices. Where possible, information is retrieved from DTS. BUG=b:239712345 BRANCH=none TEST=Compile firmware for bloonchipper. Change-Id: I9256fd85c679d4a6d98a29ad30850312c4fee0eb Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4226836 Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Patryk Duda <patrykd@google.com> Commit-Queue: Patryk Duda <patrykd@google.com>
* Kconfig: configure image size with binman's propertyDino Li2023-02-111-0/+2
| | | | | | | | | | | | | | | | | | | Since hash calculation has changed to fully calculate rw image. This change was made to allow board code to reconfigure image size with binman node to save the calculation time. The configuration of CROS_EC_RO_SIZE and CROS_EC_RW_SIZE of the chip needs to be removed to take effect. BRANCH=none BUG=none TEST=build mtlrvpp_mchp, nivviks, and yaviks. zmake compare-builds -a Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I8d0684bf1926b54d3501385e5623b849374ffcef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4165992 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr/test: Unset CONFIG_ASSERT_TEST for driver testsRob Barnes2023-02-101-1/+3
| | | | | | | | | | | | | | | Unset CONFIG_ASSERT_TEST for driver tests. This flag will mask assert failures in tests. BUG=b:268638354 BRANCH=None TEST=Pass driver unit tests Change-Id: I2dff6e78fe62a9fce01b2079055008925de64203 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240495 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr/test: Move console_cmd_crash to separate testRob Barnes2023-02-106-1/+19
| | | | | | | | | | | | | | | | The console_cmd_crash test needs CONFIG_ASSERT_TEST set. Moving console_cmd_crash to be stand alone under drivers so this flag is not polluting any other tests. BUG=b:268638354 BRANCH=None TEST=Pass driver unit tests Change-Id: I5ee5de583b61c77cc483d41dc32c5a4eb0bf9585 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240330 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: add comments for tcpc driverJason Yuan2023-02-102-1/+5
| | | | | | | | | | | | | | | | added comments for tcpc driver left out from 4108942 BUG=b:254148652 TEST=none BRANCH=none Change-Id: Iaaa32b8a7bcd80be508707eabfb012728f9768b5 Signed-off-by: Jason Yuan <jasonyuan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4238018 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Auto-Submit: zhi cheng yuan <jasonyuan@chromium.org> Tested-by: zhi cheng yuan <jasonyuan@chromium.org>
* tasks: Return TASK_ID_INVALID on errorRob Barnes2023-02-104-5/+20
| | | | | | | | | | | | | | | | | | Return `TASK_ID_INVALID` when `task_get_current` fails to find the current task instead of 0. 0 is a valid task id. `drivers.host_cmd_thread` test is also updated because it was dependent on this bug. By overriding `in_host_command_main` to return true when the fake main thread is running, `task_get_current` will return `TASK_ID_HOSTCMD` when the fake main thread is running. BUG=b:268477571 BRANCH=None TEST=Unit tests Change-Id: I2d5d6926cc9e2775a1c0e8141d760850bf25141b Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240327 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* winterhold: Disable EC_EEPROM_CBI_WPLogan_Liao2023-02-101-3/+0
| | | | | | | | | | | | | | | | | | Remove CONFIG_PLATFORM_EC_SYSTEM_UNLOCKED. BRANCH=none BUG=b:267974153 TEST=Verify that cbi write not works on winterhold for disable factory mode. Change-Id: Iccc3744e31fff7d092b65ff0b7c3fd4f6c23a16f Signed-off-by: Logan_Liao <Logan_liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4236323 Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Commit-Queue: Logan Liao <logan_liao@compal.corp-partner.google.com>
* cq: Don't exclude board specific code from covJeremy Bettis2023-02-101-1/+0
| | | | | | | | | | | | | | | | Since we now know how to test board specific code, stop excluding it from the per-board coverage reports. BRANCH=None BUG=b:268490916 TEST=Ran report and posted diffs to bug Change-Id: Id1e2ba38a18be8f0b7fa8494d5f44df519315b6a Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4233935 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* geralt: turn off 5V before hibernatedEric Yilun Lin2023-02-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix immediate waking up from hibernate. Asserting EN_ULP will turn off the following in sequence: 1. PP3300_Z1 2. EC and GSC off 3. EC/GSC pull down the LID_OPEN_3V3 4. PP5000_Z1 off The leakage from PP5000_Z1 causes a pulse on LID_OPEN_3V3 in step 3~4, which is a wake source of hibernation. We set PP5000_Z1 to off before EN_ULP to fix the issue BUG=b:268448792 TEST=not waking up immediately after hibernated BRANCH=none Change-Id: I659b8e1389d69c1e863fb53f4c3e688bc65cc2cc Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4236858 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com>
* geralt: use mt8188 power sequenceEric Yilun Lin2023-02-104-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use MT8188 power sequence. BUG=b:267268982 TEST=* Cold reset: $ dut-control cold_reset:on sleep:0.2 cold_reset:off Result: G3 -> S0 * Long power press to shutdown: $ dut-control dut-control power_key:9.2 Result: S0 -> S5 -> G3 * Long power press to power-on but then shutdown: $ dut-control dut-control power_key:9.2 Result: G3 -> S0 -> S5 -> G3 * Short power press to power-on: $ dut-control dut-control power_key:tab Result: G3 -> S0 * Console command: apreset Result: S0 -> S0, AP reboots * Console command: apshutdown Result: S0 -> S5 -> G3 * Lid open to power-on: $ dut-control lid_open:no sleep:0.2 lid_open:yes Result: G3 -> S0 BRANCH=none Change-Id: Ifa922c1650c5f7e4ab881f17df6585993f13cc9a Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4219279 Commit-Queue: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com>
* power/mt8186: support mt8188 power sequenceEric Yilun Lin2023-02-105-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MT8186 and MT8188 chipset have similar power sequence, so we re-use the mt8186.c. Add power signal EN_PP4200_PG_S5, which controls the PP4200 rail and which is PMIC's VCC. We turn it on/off at S5->S3/S3->S5. Also, drop cros-ec support, which is not used. BUG=b:267268982 TEST=* Cold reset: $ dut-control cold_reset:on sleep:0.2 cold_reset:off Result: G3 -> S0 * Long power press to shutdown: $ dut-control dut-control power_key:9.2 Result: S0 -> S5 -> G3 * Long power press to power-on but then shutdown: $ dut-control dut-control power_key:9.2 Result: G3 -> S0 -> S5 -> G3 * Short power press to power-on: $ dut-control dut-control power_key:tab Result: G3 -> S0 * Console command: apreset Result: S0 -> S0, AP reboots * Console command: apshutdown Result: S0 -> S5 -> G3 * Lid open to power-on: $ dut-control lid_open:no sleep:0.2 lid_open:yes Result: G3 -> S0 BRANCH=none Change-Id: I76bf3e4c4352982132e37bf952c29c4fce60f630 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4219278 Commit-Queue: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
* Frostflow : PS8811 initial setting.Logan_liao2023-02-102-5/+124
| | | | | | | | | | | | | | | | | | Base on the Parade FAE, modify the PS8811 setting for 10G RX test. LOW_COVERAGE_REASON=test PS8811 retimer setting valid, use b/267711586 to tracking test. BUG=b:263458745 BRANCH=none TEST=local build for HW test 10G RX pass. Change-Id: I356eb04706866e3ededc493f8aa41c41af3f5a37 Signed-off-by: Logan_liao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199248 Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Chao Gui <chaogui@google.com> Commit-Queue: Chao Gui <chaogui@google.com>
* zephyr/test/skyrim: Add alt charger testRobert Zieba2023-02-097-2/+106
| | | | | | | | | | | | | Add alt charger test for crystaldrift and skyrim. BRANCH=none BUG=b:247151116 TEST=Ran tests and verified coverage results Change-Id: Ic186d18a2ceaf65f077ca997bc4f9e86f9901766 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4233934 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: move usbc interrupt handler to shimJason Yuan2023-02-0968-278/+451
| | | | | | | | | | | | | | | | | | | TCPC interrupt no longer uses gpio-int. Instead the shim tcpc completely handles its own interrupt. An optional config is added to allow projects to use the legacy tcpc interrupt. The program intelrvp is excluded from this CL. BUG=b:254148652 TEST=twister, usbc charging on villager, lazor, and xivu BRANCH=none Change-Id: Ieeb4fb61ca6cf8f44df212a6cf520d265cff5147 Signed-off-by: Jason Yuan <jasonyuan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4108942 Commit-Queue: zhi cheng yuan <jasonyuan@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Diana Z <dzigterman@chromium.org>
* zephyr/test/skyrim: Add fan testRobert Zieba2023-02-099-3/+147
| | | | | | | | | | | | | | Add fan test and enable test for skyrim, crystaldrift and markarth variants. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: I7d11d28c1a864b24e06a1464160662f994509adf Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4225008 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* geralt: enable I2C PEC and I2C retry on NAKEric Yilun Lin2023-02-091-0/+2
| | | | | | | | | | | | | | | | | | We've seen that the i2c devices on the ports sometimes return NAK due to device busy, or too much traffic on the port. Enable the i2c controller to resend the command when NAK happens. BUG=none TEST=none BRANCH=none Change-Id: I5a26a19a864f92cf6c45c103610585891fb7bced Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4218836 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>