summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* yaviks: update thermal settingfactory-trogdor-15210.B-mainZick Wei2022-10-241-16/+16
| | | | | | | | | | | | | | Update thermal table to V1-2_20221024. BUG=b:253557900 BRANCH=none TEST=verify fan speed work intended. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ib4413c7bad5dc9d5e49cd6565415f23e31b1d1bb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3971461 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Peter Marheine <pmarheine@chromium.org>
* gpio: npcx: fix incorrect report from gpio_get_flags_by_maskJun Lin2022-10-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | The current driver reports the configured level regardless of the GPIO's direction (input/output). It should report it only when the pin in question is an output. Also, it should read the level from the PxDOUT register instead of the PXDIN register. BRANCH=none BUG=b:254739925 TEST=build npcx9_evb with CONFIG_GPIO_GET_EXTENDED and CONFIG_CMD_GPIO_EXTENDED defined, check the report form `gpioget` console command is correct. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I1f40bb757c1a012697374b294b57934608d5e293 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967955 Tested-by: CH Lin <chlin56@nuvoton.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Andrew McRae <amcrae@google.com> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* moli: add genvif overridesElsie Shih2022-10-241-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | Using VifEditorRelease_v3.4.0.0 to validate the resulting VIF file. List all changes for moli - Add USB4™ Product (USB4 Router 0/ 1) - Add USB4™ Port - Host_Speed to USB 3.2 Gen 2x1 - Host_Contains_Captive_Retimer to true - Host_Truncates_DP_For_tDHPResponse to false - Host_Suspend_Supported to true - Product_Type_UFP_SOP to PSD - Product_Type_DFP_SOP to PDUSB Host - Add SOP Modes BUG=b:254579518 BRANCH=none TEST=make BOARD=moli Signed-off-by: Elsie Shih <elsie_shih@wistron.corp-partner.google.com> Change-Id: I1d043014181946cb17338cf2947db307a0dc19b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967910 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* led/tlc59116f: Set brightness before driver disablestabilize-15208.B-mainstabilize-15207.B-mainLeila Lin2022-10-221-0/+9
| | | | | | | | | | | | | | | | | Set brightness to 0 before disable rgbkb backlight to make sure keyboard backlight is off. BUG=b:251332820 BRANCH=brya TEST=mithrax can close rgbkb backlight when lid close Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com> Change-Id: I3fc1e2139608c2db142c52dc82d96a111d2f3bc0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3971237 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Commit-Queue: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Tested-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com>
* pujjo: disable volume button in clamshell skuarthur.lin2022-10-212-1/+9
| | | | | | | | | | | | | | | | Disable volume button function in clamshell sku. BUG=none BRANCH=none TEST=zmake build pujjo Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com> Change-Id: Iceee9a20338f1ad5ec1bfb6a72356611c6f3a3a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967956 Reviewed-by: Andrew McRae <amcrae@google.com> Code-Coverage: Andrew McRae <amcrae@google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Andrew McRae <amcrae@google.com>
* gpio: Read actual pin level rather than the output setAndrew McRae2022-10-213-26/+1
| | | | | | | | | | | | | | | | | | | | | | | Read the actual pin level rather than the value that was set for the output GPIO. Code that requires obtaining the value that was written to the output should use the legacy gpio_get_flags() or the zephyr gpio_pin_get_config() API. This change essentially reverts the fix for b/236094811, which is no longer needed since the GPIOs in question are handled by the Zephyr AP power signal API. BUG=b:254057906 TEST=./twister -T zephyr/test/drivers BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Iaf51b0c4f9b821fe9b00c10023209a93f718f8e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3963945 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* Pazquel360: Modify motion sensor matrixTang Qijun2022-10-211-3/+3
| | | | | | | | | | | | | | | | | | Modify kx022 and BMI323 matrix BUG=b:237421404 BRANCH=main TEST=1. Check X/Y/Z value and lid angle is correct by console command ‘accelinfo on’ 2. Factory toolkit calibration passed Signed-off-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com> Change-Id: I5a2bafb5349ca5b5739f768b62fd61e1a2729997 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3970297 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Chao Gui <chaogui@google.com> Reviewed-by: Bob Moragues <moragues@chromium.org> Commit-Queue: Bob Moragues <moragues@chromium.org>
* util: Add ability to configure clangd for ZephyrAndrea Grandi2022-10-211-1/+32
| | | | | | | | | | | | | | | | BRANCH=none BUG=b:236389226,b:176500425 TEST=./util/clangd_config.py --os zephyr herobrine TEST=./util/clangd_config.py herobrine TEST=./util/clangd_config.py --os zephyr herobrine ro TEST=./util/clangd_config.py herobrine ro Signed-off-by: Andrea Grandi <agrandi@google.com> Change-Id: I063652e8faf4f6e0443bb2abf2d654cb674d17ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3939615 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* test: Add basic test of std::vectorAndrea Grandi2022-10-216-0/+98
| | | | | | | | | | | | | | | | Verify that dynamic memory allocation works correctly. BUG=b:243964606 TEST=util/run_device_tests.py --board=dartmonkey \ --tests=std_vector TEST=make run-std_vector BRANCH=none Signed-off-by: Andrea Grandi <agrandi@google.com> Change-Id: Iae7ff1070786e3d5e3c8ba4dcddeeeb9979b0306 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3969861 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Bobby Casey <bobbycasey@google.com>
* test: Add tests for all paths leading to warm resetYuval Peress2022-10-211-0/+91
| | | | | | | | | | | | | | | Add tests for all the code paths (including error and timeout cases) that lead up to a warm reset being initiated. BRANCH=none BUG=none TEST=twister Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Idbb8b90efe31bc36f415809a0eb234b073f8037f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965713 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* board/corori2: Free up more flash spaceTom Hughes2022-10-212-2/+4
| | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I03be805b2559d9c818607a016a97acf86f83b7ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3952908 Reviewed-by: Edward Hill <ecgh@chromium.org>
* util: add NDS architecture to crash_analyzerRicardo Quesada2022-10-211-1/+54
| | | | | | | | | | | | | | | This CL adds the Andes 32 (NDS32) architecture to the crash analyzer util. BUG=b:253492108 TEST=./crash_analyzer.py -f /tmp/dumps/ -m ampton.map Where Ampton is an NDS32 architecture. BRANCH=None Change-Id: I6a479d51b73be7cadcdb7616cff93b5b41c89fc6 Signed-off-by: ricardoq@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967701 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* util: Make it easier to add new arch in crash_analyzerRicardo Quesada2022-10-211-73/+157
| | | | | | | | | | | | | | | | | | This CL changes crash_analyzer so that it is easier to add new supported architectures. Additionally it adds the following debugging features: - an optional parameter that allows to print the print of the crash report - print the "crash cause" in human-readable format BUG=None TEST=./crash_analyzer lite -n -m file.map -f /tmp/dumps BRANCH=None Change-Id: I45a9650b400d4be1d4a14459d107fa8729ef62d6 Signed-off-by: ricardoq@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967699 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: cleanup license informationKeith Short2022-10-2110-10/+10
| | | | | | | | | | | | | | | | Remove the trailing period after ChromiumOS Authors, which is not allowed by the pre-sumbit checks. BUG=none BRANCH=none TEST=zmake build -a Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I6075656f4b565a768448102c750b8a1299efc40d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3968443 Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Yuval Peress <peress@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* TCPM: Remove unreachable codeAbe Levkoy2022-10-211-4/+1
| | | | | | | | | | | | | | | | Remove default: statement from pd_srccaps_dump. The switch statement has cases for all 4 possible values of PDO Type, so the default case is unreachable. Initialize pdo_type to satisfy the compiler. BUG=b:236074634 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I4d491663e3fbf648483df6af6d3c9ed8190dc79e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3968447 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* core/cortex-m0: Move exception_panic to assemblyTom Hughes2022-10-214-42/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're jumping through a lot of hoops trying to get the compiler to do what we want with inline assembly. It's making the code hard to read and subject to not-well-defined behavior of the compiler. The pure assembly is unambiguous. Before this change: 080164c0 <exception_panic>: 80164c0: 4b08 ldr r3, [pc, #32] ; (80164e4 <exception_panic+0x24>) 80164c2: 4809 ldr r0, [pc, #36] ; (80164e8 <exception_panic+0x28>) 80164c4: 469c mov ip, r3 80164c6: f3ef 8109 mrs r1, PSP 80164ca: f3ef 8205 mrs r2, IPSR 80164ce: 466b mov r3, sp 80164d0: c0fe stmia r0!, {r1, r2, r3, r4, r5, r6, r7} 80164d2: 4641 mov r1, r8 80164d4: 464a mov r2, r9 80164d6: 4653 mov r3, sl 80164d8: 465c mov r4, fp 80164da: 4675 mov r5, lr 80164dc: c03e stmia r0!, {r1, r2, r3, r4, r5} 80164de: 46e5 mov sp, ip 80164e0: f7ff ffb4 bl 801644c <report_panic> 80164e4: 20003f70 .word 0x20003f70 80164e8: 20003f74 .word 0x20003f74 After this change: 08016334 <exception_panic>: 8016334: 4b08 ldr r3, [pc, #32] ; (8016358 <pstack>) 8016336: 4809 ldr r0, [pc, #36] ; (801635c <pregs>) 8016338: 469c mov ip, r3 801633a: f3ef 8109 mrs r1, PSP 801633e: f3ef 8205 mrs r2, IPSR 8016342: 466b mov r3, sp 8016344: c0fe stmia r0!, {r1, r2, r3, r4, r5, r6, r7} 8016346: 4641 mov r1, r8 8016348: 464a mov r2, r9 801634a: 4653 mov r3, sl 801634c: 465c mov r4, fp 801634e: 4675 mov r5, lr 8016350: c03e stmia r0!, {r1, r2, r3, r4, r5} 8016352: 46e5 mov sp, ip 8016354: f000 f890 bl 8016478 <report_panic> 08016358 <pstack>: 8016358: 20003f70 .word 0x20003f70 0801635c <pregs>: 801635c: 20003f74 .word 0x20003f74 BRANCH=none BUG=b:172020503 TEST=compare disassembly of exception_panic (see above) TEST=make BOARD=discovery-stm32f072 test-panic openocd -c "set BOARD discovery-stm32f072" \ -c "set BUILD_DIR build/discovery-stm32f072/panic" \ -f board/discovery-stm32f072/openocd-flash.cfg screen /dev/ttyUSB1 > runtest Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Id11c06a14475a81746fa355d0a07e82616574e10 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3299275 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* Add ability to get struct offsets for use in assemblyTom Hughes2022-10-214-0/+53
| | | | | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=Using https://crrev.com/c/3299275: make BOARD=discovery-stm32f072 -j manually inspect generated file: build/discovery-stm32f072/RW/core/cortex-m0/asm_offsets.h Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I6c5a982a88ed1e77f8e98b9a0a451d52d5c03a87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3299274 Reviewed-by: Diana Z <dzigterman@chromium.org>
* util: panic info fuzzerAl Semjonovs2022-10-201-0/+22
| | | | | | | | | | | | | | Add fuzzer for parse_panic_info BUG=None BRANCH=NONE TEST=./ec_panicinfo_fuzzer -runs=5000 Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: Iab9ed0cd0d639ebf17db95c7f060512adcc69fb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3964545 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* test: EC_CMD_GET_CMD_VERSIONSAaron Massey2022-10-202-0/+56
| | | | | | | | | | | | | | | | | | | | Add tests that validate the following scenarios when invoking the EC_CMD_GET_CMD_VERSIONS host command: Test Scenarios: * v0 of command retrieving versions for v0 | v1 cmd * v1 of command retrieving versions for only v0 * v1 of command retrieving versions for bad cmd BRANCH=none BUG=b:236074903 TEST=twister -i -s zephyr/test/drivers/drivers.host_cmd --coverage' Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I8d36d32416fbdab61e23a612fb8937d8a3bf299f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967306 Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: EC_CMD_TEST_PROTOCOLAaron Massey2022-10-203-1/+66
| | | | | | | | | | | | | | | | | | | | | Add tests that verifies the EC_CMD_TEST_PROTOCOL host command simply echoes back the host's commands parameter information in the form of a response struct. Scenarios: * Successful echo of max data from response. * Unsuccessful echo of 0 data from response. BRANCH=none BUG=b:236074825 TEST=twister -i -s zephyr/test/drivers/drivers.host_cmd --coverage' Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Ia4c04f95fb5d471005195cb8b0be69b2c5ecd25c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967700 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* test: Exclude void overridable stubs from coverageAaron Massey2022-10-201-0/+9
| | | | | | | | | | | | | | | Exclude overridable functions that have zero behavior and return no values from coverage. BRANCH=none BUG=b:252887178 TEST=twister -s zephyr/test/drivers/drivers.power_host_sleep --coverage Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I7fabfb2215af745809a13ee534922a5431868df5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3956206 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Yuval Peress <peress@google.com>
* util/build_with_clang: eve and poppy now compileTom Hughes2022-10-201-2/+2
| | | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=eve TEST=CC=clang make BOARD=poppy Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I731873f4f24fe943801a6394838e8b764823c978 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953491 Reviewed-by: Keith Short <keithshort@chromium.org>
* frostflow: disable HUB_RSTMatt Wang2022-10-203-1/+14
| | | | | | | | | | | | | | | | | The frostflow does not have the CM3401FFA USB hub. BUG=b:253506651 BRANCH=none TEST=zmake build frostflow success LOW_COVERAGE_REASON=Frostflw doesn't have the USB hub. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I07c50af97fe82c9bb6e281a16453f291d73d32cf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3962230 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: SamSP Liu <samsp_liu2@compal.corp-partner.google.com> Commit-Queue: Chao Gui <chaogui@google.com>
* test: host_request_expected_size()Aaron Massey2022-10-202-0/+52
| | | | | | | | | | | | | | | | | | | | | | | Add a test suite that verifies the host_request_expected_size() function returns the expected host packet size given a host request packet header. Scenarios tested: * mismatched host request version * reserved bits in packet header set * Valid parameters result in header datalength used to determine packet size BRANCH=none BUG=b:254647370 TEST=twister -i -s zephyr/test/drivers/drivers.host_cmd Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Ie4b93a90a6d6b2ca55638de7936ed50e8410933c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967308 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* host_command: Remove EC_CMD_READ_TESTAaron Massey2022-10-204-108/+1
| | | | | | | | | | | | | | | | | | | | | | | | The EC_CMD_READ_TEST expected "response_size" to be explicitly set by the host as greater than zero. This is not how the host commands are used and there is not a single other host command that behaves in this way. This expectation resulted in a return value of EC_RES_ERROR every time the host command was invoked. It's been broken in this way for about 4 years, which indicates the host command is not used. Remove the EC_CMD_READ_TEST to gain a bit of flash space back. BRANCH=none BUG=b:254534089 TEST=zmake build herobrine image report TEST=ectool without removal of host command TEST=CQ Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I2a6cfd4352fb9da1890463a7fadfd0e08c1fb989 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3967307 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* motion_sense_fifo: Remove mutex around _needed/_reset flagsGwendal Grignou2022-10-201-14/+2
| | | | | | | | | | | | | | | Since these functions and setting the flags are always done in the motion sensor stack, mutex are not needed. BUG=none BRANCH=many TEST=make buildall Change-Id: I69bd3bced554e7aff66622b7ffb76e2d72fa9a9d Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3966708 Reviewed-by: Yuval Peress <peress@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr test: Sort drivers testcasesAbe Levkoy2022-10-202-46/+46
| | | | | | | | | | | | | | | Sort testcase.yaml by test name and Kconfig by config name. This should be a no-op change. BUG=none TEST=twister -T zephyr/test/drivers BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Iaeed3c54da3c589f468918c5a56cb5cea16fe2d0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3966685 Reviewed-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Aaron Massey <aaronmassey@google.com>
* Magikarp: enable EC_BATTERY_REVIVE_DISCONNECTelmo_lan2022-10-201-2/+3
| | | | | | | | | | | | | | | | Magikarp support EC_BATTERY_REVIVE_DISCONNECT. LOW_COVERAGE_REASON=krabby board test under development(b/243841599) BUG=b:242937675 TEST=zmake build magikarp --clobber BRANCH=None Signed-off-by: elmo_lan <elmo_lan@compal.corp-partner.google.com> Change-Id: If58b4da2a48aed3b4f49427f5782b7cacbe5d8fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3930041 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: SamSP Liu <samsp_liu2@compal.corp-partner.google.com>
* dojo: Add suspend_resume_power_signal_interruptTommy Chung2022-10-203-13/+34
| | | | | | | | | | | | | | | | | Put nvme_enable in AP_IN_SLEEP_L interrput routine to ensure that the timing of EN_PP3300_SSD can be enabled right after chipset resume so that the PCIe driver timeout will not happen. BUG=b:236790585 BRANCH=cherry TEST=make sure nvme enable timing will not cause PCIe driver timeout when chipset resume. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I34e1c6ad820cb33cdba272dc6f1f22fd52eeacc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3793403 Reviewed-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Devin Lu <devin.lu@quantatw.com>
* krabby/tentacruel: enable i2c fifo mode on i2c1Dino Li2022-10-202-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I2C clock stretching allow devices to hold clock down to block communication temporarily when they are busy. And there is no limit for the duration for clock stretching. Most devices support this feature. But smart battery gauge ICs follow SMBus specification not i2c specification. SMBus spec is not allowed clock low over 25ms. If timeout is over 25ms, master might read the wrong data (eg. 0xff, because device has released data line). This change enables FIFO mode on i2c1 and disable i2c2’s FIFO mode. Because they share the same FIFO module. Only one port can use the FIFO module at a time. With FIFO mode enabled, EC only needs to set how much data will be send or receive to i2c controller. The controller will process transaction automatically without CPU intervention. So clock stretching between bytes on i2c1 can be eliminated. This change also disable CONFIG_PLATFORM_EC_SMBUS_PEC to perform single transfer for i2c read/write/write to read. BRANCH=none BUG=b:253349747, b:250746976 TEST=On tentacruel, EC will not stretch clock more than 25ms on i2c1. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: Idb4433bf1d54b2c684268e88c64b0b37a8294921 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3950277 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* crota: sync FW_CONFIG form_factorScott Chao2022-10-201-1/+5
| | | | | | | | | | | | | This will sync form_factor bit in FW_CONFIG with config.star(chrome-internal:5004031). BUG=b:254402731 BRANCH=none TEST=make -j BOARD=crota Change-Id: Iebf5db8e69b925cc890980fe45879176c79c839d Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3963944 Reviewed-by: caveh jalali <caveh@chromium.org>
* Winterhold: Adjust keyboard top rowjohnwc_yeh2022-10-202-0/+30
| | | | | | | | | | | | | | | | | The vivaldi keyboard of winterholdis different to the common config. So we adjust it. BUG=b:253696885 BRANCH=none TEST=zmake build winterhold and verify with evtest LOW_COVERAGE_REASON=Skyrim board tests not created yet: b/247151116 Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Change-Id: Ic99472f3c87baf505093aa063bc8deb88fa10a90 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3962235 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* pujjo: Disable the DPS configtony.tang2022-10-201-1/+4
| | | | | | | | | | | | | Disable the DPS config BUG=b:249359309 BRANCH=none TEST=zmake build pujjo Signed-off-by: tony.tang <tony.tang@lcfc.corp-partner.google.com> Change-Id: Idf3e779c211054972e307737c58f9c67ae9124e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965969 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* zephyr/test: add krabby usb mux board init testlschyi2022-10-207-3/+110
| | | | | | | | | | | | | | | | | | Add testing for checking the krabby project usb mux init. Enable USBC and other related functionality in krabby test config, and update the it8xxx2 emul configuration. BUG=b:229340646 TEST=./twister -p native_posix -p unit_testing BRANCH=none Signed-off-by: lschyi <lschyi@google.com> Change-Id: I981e89eeecd58b78e6a256fe154611f2a2a50ead Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965889 Tested-by: Sung-Chi Li <lschyi@chromium.org> Commit-Queue: Sung-Chi Li <lschyi@chromium.org> Code-Coverage: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* zephyr/test: add tusb1064 usb mux emulatorlschyi2022-10-207-0/+140
| | | | | | | | | | | | | | | | | Implemented tusb1064 usb mux emulator with basic i2c read/write, and export peek reg functions. BUG=b:229340646 TEST=none BRANCH=none Signed-off-by: lschyi <lschyi@google.com> Change-Id: Ie91c216a6d1fb9ffc1decbb07c2b082b02bf8cda Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965888 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Sung-Chi Li <lschyi@chromium.org>
* krabby: set display port EQ valuelschyi2022-10-202-0/+20
| | | | | | | | | | | | | | | | | Set the board specific display port EQ value. BUG=b:229340646 TEST=run on krabby and check the TUSB546 register is set to 0x84 with i2c read_byte on EC console. BRANCH=none Signed-off-by: lschyi <lschyi@google.com> Change-Id: I716bc83f17e5d855d8aeb35fa6f31101d47f7b75 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3950272 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Sung-Chi Li <lschyi@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* yaviks: update keyboard mappingZick Wei2022-10-201-2/+58
| | | | | | | | | | | | | | | | Update different keyboard mapping to cbi fw_config. BUG=b:249388097, b:249388270 BRANCH=none TEST=manually update cbi fw_config and make sure keyboard work intended. LOW_COVERAGE_REASON=board-specific code Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I09970d16626d74d6c103c83f9eadd217009d7fa3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3954784 Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org>
* zephyr: mchp: Support adlrvp_mchp projectmartin yan2022-10-1911-2/+842
| | | | | | | | | | | | | | | | | | | | | | | | | | | Support adlrvp_mchp project, run on Intel ADL RVP with mec1727 MECC card, pass ADL required FAFT. BUG=none BRANCH=main TEST=zmake build adlrvp_mchp, verify following functions on RVP -- Power on / off sequence: S0/S3/S5/G3; -- Boot up to Chromium OS; -- UART console; -- Battery and charger via I2C interface; -- Keyscan matrix; -- Power button / LID / AC present switches; -- WDT; -- 512KB SPI RO/RW images for EC Rom loader; -- Sysjump RW/RO and hash; -- System hibernate; -- Flash access - flashread / flashwrite / flasherase; -- Rebase on 10/18/2022; Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I43dfd24c92126b59956e5d0192b1f62b8b05e798 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3606924 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Skyrim: Add project PIDDiana Z2022-10-191-1/+1
| | | | | | | | | | | | | | Add a new PID for skyrim, rather than using the guybrush PID. BRANCH=None BUG=b:254475831 TEST=deploy on skyrim and observe PID reported in DiscoverIdentity ACK Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Icc565deb711d18a305106e8d2e15273bba730e0f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3966680 Commit-Queue: Mark Hasemeyer <markhas@google.com> Reviewed-by: Mark Hasemeyer <markhas@google.com>
* tree: Enable warning for fallthrough in switch statementsTom Hughes2022-10-1953-44/+86
| | | | | | | | | | | | | | | | | | | | | | | The EC code has generally been good about adding comments about intentional fallthrough in switch statements, but there were a few cases without comments (e.g., https://crrev.com/c/3949622). Enabling -Wimplicit-fallthrough generates a compiler warning if the fallthrough is not annotated with __attribute__((fallthrough)). For convenience, we add a "__fallthrough" macro for this attribute. See https://clang.llvm.org/docs/AttributeReference.html#fallthrough and https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html. BRANCH=none BUG=b:253644823 TEST=make buildall LOW_COVERAGE_REASON=legacy code Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I9f4d6049f4507a25ce706675d159b70e28b4b825 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957420 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* battery_fuel_gauge: battery cutoff as staticAaron Massey2022-10-192-18/+14
| | | | | | | | | | | | | | | | | | | | | | The cut_off_battery_block_write() and cut_off_battery_sb_write() functions are only ever used in the same source they are defined in. Since these functions are only privately used, remove their header declarations and make them static. BRANCH=none BUG=none LOW_COVERAGE_REASON=Change of function signature TEST=zmake build -a TEST=make runhosttests -j TEST=CQ Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Ic63c425870b338637a8e3996fa808842db85a18c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3966713 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Sam Hurst <shurst@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: EC_CMD_DISPLAY_SOCAaron Massey2022-10-192-0/+33
| | | | | | | | | | | | | | | | | Verify that the EC_CMD_DISPLAY_SOC host command fetches the displayed state of charge and the constants: full-factor and shutdown-state-of-charge in values where each increment is 1/10th of a percent. BRANCH=none BUG=b:236075098 TEST=twister --clobber -i -s zephyr/test/drivers/drivers.host_cmd Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Ife2400b7d887214b791e0608a836355e6cf34316 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3966712 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* gitlab: Fix a typo in lcov commandJeremy Bettis2022-10-191-1/+1
| | | | | | | | | | | | | | | | | | There was a "" that should have been " BRANCH=None BUG=None TEST=None Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I54f056b3798b1ee8eec937a9eab3145bdbeaff52 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3966677 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Aaron Massey <aaronmassey@google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Yuval Peress <peress@google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
* gitlab: Fix yaml errorJeremy Bettis2022-10-191-1/+1
| | | | | | | | | | | | | | | | Fix yaml formatting BRANCH=None BUG=None TEST=yaml syntax checker Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I304499f88c7198c28c4f193be04a3e5d6650e123 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965506 Commit-Queue: Yuval Peress <peress@google.com> Reviewed-by: Yuval Peress <peress@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
* ec: Remove fake suspend from qcom.cJeremy Bettis2022-10-191-37/+1
| | | | | | | | | | | | | | | | | This was intended to be a short term solution for local testing during bringup of trogdor. It is no longer needed. BRANCH=None BUG=b:148149387 TEST=None Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I2bca46c9a6e07caf13e72255b8a16d7dada3058c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3964547 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: Add more qcom testsJeremy Bettis2022-10-194-7/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | Add new cases for booting from power button where power good times out and when the battery is too low to boot. Add new case for the suspend timing out. Add case for resume from suspend. Allow mocking system_can_boot_ap() because the alternative is to add 10 emulators to get an emulated battery level. Exclude 4 lines that are an impossible error case. BRANCH=None BUG=None TEST=twister Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Icbc7ac579c8f6d2b7e5535a63eb2eca705b9bd06 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3962308 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: Add setup func to qcom testsJeremy Bettis2022-10-191-74/+36
| | | | | | | | | | | | | | | | Move common setup code to get into S0 to the suite setup function. BRANCH=None BUG=None TEST=twister Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I06a5d8fc327ce581047759245a0500cf760c1f1c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965277 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: mchp: Support QMSPI_FULL_DUPLEX drivermartin yan2022-10-192-1/+2
| | | | | | | | | | | | | | Chrome code applies generic spi_nor.c to access flash chip, require QMSPI_FULL_DUPLEX driver to adapt it. BUG=none BRANCH=main TEST=zmake build -a Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I40628f3f2582a2b1549350040323945cff2ca31a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965169 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* yaviks: update cbi fw_config fieldZick Wei2022-10-192-0/+100
| | | | | | | | | | | | | BUG=b:251593313 BRANCH=none TEST=On yaviks, manually set fw_config make sure each function work intended. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: If3448655ee6efb397dae1af6c969212670af3369 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3954783 Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org>
* zephyr: mchp: Disable CONFIG_PINMUXmartin yan2022-10-192-30/+1
| | | | | | | | | | | | | | | Fully support pinctrl configuration, then disable pinmux configuration BUG=none BRANCH=main TEST=zmake build -a Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I660c7f33e2ff90814a23d586c0111a3bdce9e982 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965168 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>