summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch cros/main into firmware-nissa-15217.B-mainfirmware-nissa-15217.126.B-mainPeter Marheine2023-02-16422-2549/+11911
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generated by: ./util/update_release_branch.py --zephyr --board nissa firmware- nissa-15217.B-main Relevant changes: git log --oneline dce247e979..0849542c72 -- zephyr/program/nissa util/getversion.sh 0849542c72 zephyr: add sleep property for keyboard factory test 5825d894b9 nissa: disable PLATFORM_EC_TCPC_INTERRUPT 25a400690f yavikso: Update fan table version 3 9263f14536 zephyr: remove shi node and add references to shi0 b40c6970d3 Craask: Charger limit for 65w adapter 6fd2d3ea6c zephyr: add comments for tcpc driver 00986ffb1c zephyr: move usbc interrupt handler to shim 2508094b14 yaviks: reduce RW image size (64KB) 55b6aaf52f yaviks: enable keyboard factory test 4786d1eac6 nissa: Add ocpc init function to Nissa boards 2ae1083638 zephyr: cros_kb: set KSI/KSO kbs mode by pinctrl driver d415f4665a yaviks: Fix OCPC Vsys overshooting 93f9d42a7c zephyr: config: drop few more redundant options BRANCH=None BUG=b:254148652 b:260762509 b:265220075 b:268273712 b:265763662 BUG=b:253557900 b:254148652 b:269212593 b:267404783 b:262352202 TEST=`make -j buildall` Force-Relevant-Builds: all Change-Id: I195dd82af114180b611f9afd1465a69f7f43d417 Signed-off-by: Peter Marheine <pmarheine@chromium.org>
| * 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-152-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dibbi: Configure USB_C0_SBU_MUX_FAULT as input, without pull-down.Sam McNally2023-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | It isn't currently used, but is connected, with an external pull-up. BUG=b:268309238 TEST=none BRANCH=none Change-Id: Ifc0a75b45a1b112a63b0c394086445220bf6f17d Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4252440 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
| * dibbi: Split I2C configuration from baseboard and add HDMI-related busesSam McNally2023-02-153-4/+51
| | | | | | | | | | | | | | | | | | | | | | BUG=b:269367960 TEST=i2cscan can scan all buses BRANCH=none Change-Id: Iccb3a28a24de4e82119d50a1f581162ac58913cf Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4252439 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
| * gitlab: Don't exclude board specific code from covJeremy Bettis2023-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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=None Change-Id: I6afd6044a2074e12fe60e239dbf4d3982668b101 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4257725 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
| * 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>
| * TCPMv2: Trigger ErrorRecovery for FRS corner casesDiana Z2023-02-151-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if the port partner sends a Hard Reset during the FRS sequence, we attempt to handle the Hard Reset. However, this leaves us in an inconsistent power state which can lead to the DUT sourcing itself while neither partner presents Rp. Instead, go to ErrorRecovery which is the general method of recovering from anything unexpected during the FRS sequence. Additionally, correct the state machine to go to ErrorRecovery on discard as well and when we receive a SoftReset in the middle of the FRS sequence. BRANCH=None BUG=b:266035645 TEST=on frostflow, trigger FRS with problematic dock and observe Chrome does not show charging LOW_COVERAGE_REASON=FRS support in the partner emulator needs expanded, filed b/269473786 to track this Change-Id: Icd3a9da52534ecbb9012b740b082938f66052c22 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4209978 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
| * zephyr: test: Test 'flashread' console commandTristan Honscheid2023-02-152-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * util: zephyr_check_compliance: exclude all files not under zephyrFabio Baltieri2023-02-152-25/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the zephyr_check_compliance script to actually exclude all files not under "zephyr" by patching the upstream get_files() to ignore them. This stops the script from checking file outside of the zephyr/ directory if the commit contains files both in and out of it. BRANCH=none BUG=none TEST=unit test and fake commit Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I44ccba973b8f7f5be606652d076252abaf5a0f22 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4254305 Commit-Queue: Tristan Honscheid <honscheid@google.com> Reviewed-by: Tristan Honscheid <honscheid@google.com>
| * 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>
| * kuldax: Using fw_config return peripheral charger countben chen2023-02-153-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using fw_config control in board_get_pchg_count() to determined pchg_count at runtime. some sku w/wo pheripheral charger. peripheral_charger flag address bit5 size 1 of cbi fw_config: 0 :PERIPHERAL_CHARGER_ENABLE 1 :PERIPHERAL_CHARGER_DISABLE BUG=b:267700817 BRANCH=None TEST=make BOARD PASS Change-Id: I19fe61b910274a5f1594d3d9410dfcb317a61c46 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4252926 Reviewed-by: Derek Huang <derekhuang@google.com> Commit-Queue: Derek Huang <derekhuang@google.com>
| * 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>
| * brask,coachz,constitution,kuldax,redrix: add board_get_pchg_count()ben chen2023-02-156-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implement board_get_pchg_count() to determined pchg_count at runtime. BUG=b:267700817 BRANCH=None TEST=make BOARD PASS TEST=make run-pchg_fuzz PASS Cq-Depend:chromium:4218552 Cq-Depend:chromium:4248459 Change-Id: Ic14a841132c732f30887b4e3ef8e7f7a8c8728ae Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4248823 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Derek Huang <derekhuang@google.com>
| * cps8100.c/ctn730.c: board_get_pchg_count() retun pchg_countben chen2023-02-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using board_get_pchg_count() to determined pchg_count at runtime. BUG=b:267700817 BRANCH=None TEST=make BOARD PASS Cq-Depend:chromium:4248823 Cq-Depend:chromium:4218552 Change-Id: I844bf2615bd04da38ff658b987fc205f69ceca5e Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4248459 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Derek Huang <derekhuang@google.com>
| * peripheral_charger: Add board_get_pchg_count(void) declarationben chen2023-02-152-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some hardware skus may not have peripheral charger but share the same EC firmware, add board_get_pchg_count(void), and in each board implement the int board_get_pchg_count(void) to allow charger count to be determined at runtime. BUG=b:267700817 BRANCH=None TEST=make BOARD PASS Cq-Depend:chromium:4248459 Cq-Depend:chromium:4248823 Change-Id: I62f37a9e39da7b8949ba59c314987e9d80835710 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4218552 Commit-Queue: Derek Huang <derekhuang@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: caveh jalali <caveh@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>
| * tree: Remove -Wdeclaration-after-statementTom Hughes2023-02-152-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Modern versions of C (C99 and newer) allow mixing declarations and statements, so there's no need to warn about it anymore. BRANCH=none BUG=b:147769405 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I15e5ed3f3230ab5219f6f385b7bab3185f8aae5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256741 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
| * dibbi: Update board_vbus_source_enabled() to use ppc_is_sourcing_vbus().Sam McNally2023-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | BUG=b:269050050 TEST=Boot dibbi from USB-C power BRANCH=none Change-Id: Id811b71710a53bd64e13648dfa52093d9b23bcda Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240912 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
| * dibbi: Remove configuration for CC lines.Sam McNally2023-02-152-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Dibbi is using a PPC so no explicit action is required for CC lines. BUG=b:268309238 TEST=none BRANCH=none Change-Id: I6976a3392ba18639fb41bd27076dfde7ffb3c76a Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240908 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
| * dibbi: Update USB-C i2c channel.Sam McNally2023-02-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | USB-C is using i2c bus 2 on dibbi, so update the config to channel C. BUG=b:268309238, b:269050050 TEST=EC can communicate with USB-C-related peripherals. BRANCH=none Change-Id: I65261250c93faf5d3d16714fa0a53ae369fb3c81 Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240907 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
| * dibbi: Add USB-A port 3.Sam McNally2023-02-152-1/+2
| | | | | | | | | | | | | | | | | | | | | | BUG=b:269065101 TEST=all USB-A VBUS are enabled BRANCH=none Change-Id: I4d7f3c88424ab198d84c6be38b99cd29254f76fe Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240909 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
| * dibbi: Invert BJ_ADP_PRESENT_L.Sam McNally2023-02-152-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | BJ_ADP_PRESENT is active-high now, so rename and invert the logic for anything depending on its value. BUG=b:268309238 TEST=Barrel-jack adapter is correctly detected BRANCH=none Change-Id: I37116ab3501c8aa30a8cc848be40a1ee9e107821 Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240906 Reviewed-by: Peter Marheine <pmarheine@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-1417-98/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * board/hyperdebug: Atomic setting of gpio mode and levelJes B. Klinke2023-02-141-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we use `opentitantool transport init` to configure all pins according to some "standard" initial values. This involves configuring open drain / push pull as well as setting default levels. Unfortunately, if a pin is for instance listed as being "open drain, high level" as default (no active drive), we currently have to make the choice of whether to first configure the pin as open drain output, or first configure the output to high. If we first configure the level to become 1, we run the risk that the pin was set as push pull, and it will be actively be driven high for a fraction of a second, before it is set to open drain, and goes floating. If we instead first configure the mode to become open drain, then we risk that the pin was previously in input mode, with a "leftover" value of 0 in the output register, meaning that switching to open drain mode will briefly drive the pin drongly down, before the level is set to 1. In order to avoid glitches, this CL introduces a "gpio multiset" command, which can be used to simultaneously set the output level, pin mode, and weak pull configuration of the pin. BUG=b:192262089 TEST=Watch tast test work Change-Id: Ie16771e5cb676af02a0dabe454e4173721629b30 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4245899 Tested-by: Jes Klinke <jbk@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org>
| * 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-142-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-147-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * aurash: Initial EC imageZoey Wu2023-02-1416-0/+2082
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create the initial EC image for the aurash variant by copying the brask reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.5.0). BUG=b:263691099 BRANCH=None TEST=make BOARD=aurash Change-Id: I78a4e4adc9122ce66e35278e8ff299752279c90b Signed-off-by: Zoey Wu <zoey_wu@wistron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4236324 Tested-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Commit-Queue: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
| * brask: move externs to header fileScott Chao2023-02-143-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | During pre-upload check, it will show warning that "externs should be avoided in .c files". BUG=b:268581418 BRANCH=none TEST=make buildall Change-Id: I973390da06bf6594212391bf48d6940f4ac29a07 Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4238096 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
| * CPS8100: create header fileScott Chao2023-02-141-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | This CL created the header file and also add the driver declaration. BUG=b:268581418 BRANCH=none TEST=make buildall Change-Id: I08df700f4aff4c5cbe5ccd1345652263feab36f3 Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4238095 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
| * TCPMv2: Remove PE_FLAGS_VDM_SETUP_DONEAbe Levkoy2023-02-135-18/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove a PE flag that is redundant with the discovery state. Update the discovery state where appropriate to keep it internally consistent. BUG=b:189353401 TEST=voxel: Attach TBT4 hub; verify discovery sequence BRANCH=none Change-Id: I8ea870271ee95eb1dd4633370f7e39ca789f1328 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4237156 Reviewed-by: Diana Z <dzigterman@chromium.org>
| * TCPMv2: Restrict PE VDM flag to discoveryAbe Levkoy2023-02-131-21/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set and clear PE_FLAGS_VDM_SETUP_DONE based on discovery state, because it only affects whether the PE will attempt port discovery. Do not set it after DP Config or other mode entry resolutions. Remove unreachable code to disable DiscoverIdentityTimer based on this flag. Clear it when clearing discovery data but not when just exiting modes. BUG=b:189353401 TEST=voxel: Attach TBT4 hub; observe discovery/mode entry sequence BRANCH=none LOW_COVERAGE_REASON=Covered line was optimized out Change-Id: Iae55b8c21c9244da86faed6d38bc89b3e74cf332 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4234223 Reviewed-by: Diana Z <dzigterman@chromium.org>
| * 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>