summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Makefile: Use cxx-name variable instead of hardcoding compilerfactory-guybrush-14908.B-mainTom Hughes2022-06-081-1/+1
| | | | | | | | | | | | BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Icd8bfd8d6f8d6091e1bfef36b3e45b030f8f9d9d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3681938 Reviewed-by: Edward Hill <ecgh@chromium.org>
* zephyr test: Improve SYV682x test namingAbe Levkoy2022-06-082-23/+27
| | | | | | | | | | | | | | | | The UUT for this test is the SYV682x device driver, which works for part versions A, B, and C. The (emulated) part in the devicetree is an SYV682C, but the majority of the driver interface is unaffected by the specific part. Update file, suite, and variable names to reflect this. BUG=b:234886404 TEST=zmake testall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I8024239d4f4b4aa0793ea9b1e5a4b9df126a4009 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3689799 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* zephyr test: Use fixture for SYV682x testAbe Levkoy2022-06-081-131/+166
| | | | | | | | | | | | | | Convert ZTEST to ZTEST_F. Move repeated definitions to fixture/setup function. BUG=b:234886404 TEST=zmake testall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I419c57b120ec7a17a4d70c746f75ab3d3d665225 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3689798 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr test: Format ppc_syv682c.cAbe Levkoy2022-06-081-145/+148
| | | | | | | | | | | | | Run clang-format on this test. BUG=b:234886404 TEST=zmake testall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Id111469a400bf60a48b8e0492db9c373ced97d11 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3689797 Reviewed-by: Yuval Peress <peress@google.com>
* steelix: config led behaviourwen zhang2022-06-083-34/+126
| | | | | | | | | | | | | | Config the battery/power LED behaviour according to the LED SPEC BUG=b:232050545 TEST=ectool led [battery/power] {color} BRANCH=none Change-Id: I47903c3682d1ecc84a56d93b4b14e59a5eeff272 Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3690197 Reviewed-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
* steelix: modify motionsense rotation matrixwen zhang2022-06-082-0/+18
| | | | | | | | | | | | | | | The rotation matrix of steelix is different from reference board inherit the motionsense_kingler.dts and modify its rotation matrix BUG=b:232050545 TEST=rotate the DUT and check the direction of the frame BRANCH=none Change-Id: Iccb02a51487564a66dd22f23dcecf5a5493498f0 Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3686720 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* steelix: enable tablet modewen zhang2022-06-081-1/+1
| | | | | | | | | | | | | | | Kingler enabled the tablet mode, steelix is the variant and inherit its config, we should configure the GPIO for steelix BUG=b:232050545 TEST=EC reports tablet mode when the DUT is folded over BRANCH=none Change-Id: I4ae928ef6683355f602b03a724be00023807ffed Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3694919 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* kingler: enable tablet modewen zhang2022-06-083-1/+9
| | | | | | | | | | | | | | Enable tablet mode interrupt and events BUG=b:203739613 TEST=EC reports tablet mode when the DUT is folded over BRANCH=none Change-Id: I5a7845ce20ff1f383b2238b8905fca7df850aa31 Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3694918 Reviewed-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
* corsola: Enable type c sbu in svdm_dp_post_configlschyi2022-06-081-0/+3
| | | | | | | | | | | | | | | | | | Corsola platform overrides the svdm_dp_post_config but not enable the sbu in it. Enable the type c sbu settings in svdm_dp_post_config so that external display is available. BUG=b:208372205 TEST=manually test with inserting a type c display, then check the SBU register is set enabled and external display is functioning. BRANCH=none Signed-off-by: lschyi <lschyi@google.com> Change-Id: I02096a04966e0bb4f7f1bb42df6bac904043ea8a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3694922 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Sung-Chi Li <lschyi@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org>
* kingler: Set up USB C1 SBU protection with TCPM SBUlschyi2022-06-082-6/+1
| | | | | | | | | | | | | | | | | The USB C1 SBU line in kingler is provided by TCPM module, enable it in the configuration and remove setting it from tcpc board init function. BUG=b:208372205 TEST=manually test with inserting a type c display, then check the SBU register is set enabled and external display is functioning. BRANCH=none Change-Id: I69189e19d3151181655b9290eed7d19e1c318e4f Signed-off-by: lschyi <lschyi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3682601 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Sung-Chi Li <lschyi@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org>
* rt1718s: Implement set_sbulschyi2022-06-081-0/+19
| | | | | | | | | | | | | | | | | | The rt1718s can enable the SBU protection and control in the SBU_CTRL register. Implement the set_sbu function to make projects set the SBU line protection and function within the application. BUG=b:208372205 TEST=manually test with inserting a type c display, then check the SBU register is set enabled and external display is functioning. BRANCH=none Change-Id: I13f3881ddbb3b70f04e8ea88fcb51b1cf37fd517 Signed-off-by: lschyi <lschyi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3682600 Commit-Queue: Sung-Chi Li <lschyi@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Sung-Chi Li <lschyi@chromium.org>
* zephyr: steelix: drop unused power-on configwen zhang2022-06-081-1/+4
| | | | | | | | | | | | | | Steelix only uses D2, drop the workaround config for H1 BUG=b:234572040 TEST=verify the GPIO state after sysjump rw BRANCH=none Change-Id: I4eed76ead983b6e818ca2d29add86d8c1db3cb98 Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3694921 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* corsola: drop duplicated configEric Yilun Lin2022-06-081-1/+0
| | | | | | | | | | | | | | | | The config was defined twice. BUG=none TEST=zmake BRANCH=none Change-Id: I5947c8a59b103d18e3dc83f5bd327f6645120efb Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3686968 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
* Zephyr: fix SOC Kconfig typoJosh Tsai2022-06-081-1/+1
| | | | | | | | | | | | | | | When we config the AP_X86_AMD, it should select the AP_X86 instead of AP_x86. BUG=b:234402115 BRANCH=none TEST=Skyrim can boot normally Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Change-Id: Id6bbcae21170fe483139842e1b55ee85a9c17c41 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3690044 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* include/host_command.h: Fix C++ compilation errorTom Hughes2022-06-081-1/+1
| | | | | | | | | | | | | | | | | | include/host_command.h:277:41: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] __attribute__((section(".rodata.hcmds."EXPANDSTR(0x0000, command)))) \ ^ BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I7428c6bf5fa6aa0c9440ae44d665f7d744d23c00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3691834 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* fpsensor: Use correct return typeTom Hughes2022-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | Fixes the following compilation error when building with C++: common/fpsensor/fpsensor.cc:766:11: error: cannot initialize return object of type 'enum ec_error_list' with an rvalue of type 'int' return 0; ^ BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b fp => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ib76eed91413fb856ff31501261edc8251c4149da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3691833 Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Bobby Casey <bobbycasey@google.com>
* fpsensor: Use correct return typeTom Hughes2022-06-081-1/+1
| | | | | | | | | | | | | | | | | | | Fixes the following compile error when building with C++: common/fpsensor/fpsensor.cc:373:9: error: cannot initialize return object of type 'enum ec_status' with an lvalue of type 'int' return ret; ^~~ BRANCH=none BUG=b:234181908 TEST=make buildall -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I8672a32ed08fdc3cab241fc714ed4fa813f1b16c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3691832 Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Bobby Casey <bobbycasey@google.com>
* include/console.h: Use _STATIC_ASSERT for C++ compatibilityTom Hughes2022-06-081-1/+1
| | | | | | | | | | | | BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I92ffb946b6b0cc6953fc12b7221267b5bf3abc91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3689785 Reviewed-by: Diana Z <dzigterman@chromium.org>
* RGBKBD: Set scale per keyDaisuke Nojiri2022-06-0710-117/+217
| | | | | | | | | | | | | | | | | Currently, rgbkbd_set_scale can only set a scale of all keys. This patch makes it set a scale of an individual key. rgbkbd_reset_scale will replace the previous rgbkbd_set_scale. BUG=b:233986174, b:234530397 BRANCH=None TEST=Run ectool rgbkbd scale on Vell. TEST=Run ectool rgbkbd scale on Taniks. TEST=Run rgb all, demo, reset, scale, command in EC console. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I34e6b3e41c40510eca148fcf879e8caaf57317be Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3689778 Reviewed-by: Parth Malkan <parthmalkan@google.com>
* beadrix: Update retimer of daughter boardTeddy Shih2022-06-071-0/+89
| | | | | | | | | | | | | | Update retimer of daughter board to tune signals according measurement. BRANCH=main BUG=b:235182557 TEST=on beadrix, validated by beadrix working on USB and DP functions. Signed-off-by: Teddy Shih <teddyshih@ami.corp-partner.google.com> Change-Id: I47e1c7854892aef5ebb3c4f7576a4fa2cb621e03 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3690203 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Ivan Chen <yulunchen@google.com>
* RGBKBD: Add demo sub-command to EC_CMD_RGBKBDDaisuke Nojiri2022-06-075-28/+53
| | | | | | | | | | | BUG=None BRANCH=None TEST=Vell Change-Id: Ie486b9ae6731622882b21d5273f79280770bbd17 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3657839 Reviewed-by: Parth Malkan <parthmalkan@google.com>
* ccgxxf: Add firmware version info in TCPCI dump commandVijay Hiremath2022-06-072-1/+22
| | | | | | | | | | | | | | | CCGXXF follows standard TCPCI spec registers however firmware version and build ID are vendor specific hence added a custom TCPCI dump register function. BUG=none BRANCH=none TEST=Tested on MTLRVP, correct firmware version is printed Change-Id: I8f9bf43756c607f8c5ebae4524dcf1e1d1ef43ab Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3669971 Reviewed-by: Diana Z <dzigterman@chromium.org>
* osiris: Update KYBL_EN output typeYu-An Chen2022-06-071-1/+1
| | | | | | | | | | | | | | Set KYBL_EN(GPIOA7) to GPIO_OUT_LOW from GPIO_ODR_LOW. BUG=b:233323599 BRANCH=none TEST=build pass Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I1964a76984d417dfe9c3db5a0374edb243cdc039 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3692486 Commit-Queue: Parth Malkan <parthmalkan@google.com> Reviewed-by: Parth Malkan <parthmalkan@google.com>
* lazor: Setup volume buttons for lazor onlyKnox Chiou2022-06-073-0/+12
| | | | | | | | | | | | | | | | | Lazor/limozeen share the same firmware, setup volume buttons for lazor only. BUG=b:234175434 BRANCH=trogdor TEST=emerge-trogdor chromeos-ec & ectool mkbpget buttons on lazor. Cq-Depend: chromium:3674845 Signed-off-by: Knox Chiou <knoxchiou@google.com> Change-Id: I648235491d6edda0d2cc30650fb3481abfdad2e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3685754 Tested-by: Knox Chiou <knoxchiou@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* mkbp_info: Provide run time check volume buttons functionKnox Chiou2022-06-072-3/+35
| | | | | | | | | | | | | | | | | Define a volume button override function for board specific usage, so the devices whom share the firmware could config volume buttons by run time. BUG=b:234175434 BRANCH=trogdor TEST=emerge-trogdor chromeos-ec & ectool mkbpget buttons on lazor. Signed-off-by: Knox Chiou <knoxchiou@google.com> Change-Id: I18cd25c25183f8149650ed2302a476242b2680e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3674845 Commit-Queue: Wai-Hong Tam <waihong@google.com> Tested-by: Knox Chiou <knoxchiou@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr:test: LED driver code coverageAl Semjonovs2022-06-0710-2/+414
| | | | | | | | | | | | | Tests to add coverage to LED driver code BUG=b:233607287 BRANCH=NONE TEST=zmake test test-drivers Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: I4da19d221e07709988e2cd72a11411575a349be2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3664636 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: Don't convert paths to relative in infoJeremy Bettis2022-06-071-13/+1
| | | | | | | | | | | | | | | | | The CQ recipe will now convert absolute paths to relative paths as needed, so leave the paths as absolute in the lcov file. BRANCH=None BUG=b:231639771 TEST=Ran script by hand Cq-Depend: chromium:3683588 Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I1461d935ae42ad09d3617ea506911cf5b5acbb00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3684370 Reviewed-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: LED: Make legacy and DT configs mutually exclusiveParth Malkan2022-06-071-0/+1
| | | | | | | | | | | | | | Make configs PLATFORM_EC_LED_COMMON and PLATFORM_EC_LED_DT mutually exclusive. BRANCH=None BUG=b:227798487 TEST=zmake build --all Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: Iaf34d6691662e354edfd1617644b979a1bc973cd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3685749 Reviewed-by: Keith Short <keithshort@chromium.org>
* Skyrim: Adjust tuning for C1Diana Z2022-06-071-3/+54
| | | | | | | | | | | | | | C1 requires a different setting for the equalization register. BRANCH=None BUG=b:230694492 TEST=on skyrim, plug peripherals into C1 and ensure the correct registers are observed Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I0ebfef466ad141cdf511b031ecd3ff9a6e88bf9d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3689784 Reviewed-by: Robert Zieba <robertzieba@google.com>
* ANX7483: Add EQ tuning interfaceDiana Z2022-06-073-0/+66
| | | | | | | | | | | | | | Add an API which may be used to adjust the EQ settings of pins on the retimer individually. BRANCH=None BUG=b:230694492 TEST=zmake testall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I26ddb01cb3d84ef074545d05a5836ad6e385ed92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3689783 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* clock-stm32f4: Fix minimal time the RTC alarm can be set forPatryk Duda2022-06-073-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, SET_RTC_MATCH_DELAY was set to 120 us which was way too small to setup RTC alarm properly. As a result, watchdog could reset FPMCU while it was in deep sleep (also known as STOP mode in STM32 documentation) with no additional information (because interrupts were disabled in __idle() and the core was sleeping). The problem ocurred when number of microseconds provided to set_rtc_alarm() was between 120 - 125 (typically a value slightly smaller than HOOK_TICK_INTERVAL is provided), so the probability was very low. New value was found by running this code on STM32F4 (placed in chip/stm32/clock-f.c) +volatile uint32_t int_received; + static void __rtc_alarm_irq(void) { + int_received++; + rtc_alarm_irq(); } DECLARE_IRQ(STM32_IRQ_RTC_ALARM, __rtc_alarm_irq, 1); +static int measure_rtc_setup(int argc, char** argv) +{ + struct rtc_time_reg rtc0; + + for (int us = 180; us <= 200; us++) { + int_received = 0; + for (int i = 0; i < 100000; i++) { + set_rtc_alarm(0, us, &rtc0, 0); + usleep(1000); + } + ccprints("%d us - %d received", us, int_received); + } + + return EC_SUCCESS; +} + +DECLARE_CONSOLE_COMMAND(measure_rtc, measure_rtc_setup, "", ""); The code adds 'measure_rtc' console command which is setting RTC alarm and waits 1 ms for interrupt to be triggered. In this code we are testing range from 180us to 200us, 100k times. Results from 120us to 200us, 1k times: [6.667189 120 us - 0 received] [7.680241 121 us - 0 received] [8.693295 122 us - 0 received] [9.706348 123 us - 0 received] [10.719404 124 us - 0 received] [11.732460 125 us - 466 received] [12.745519 126 us - 953 received] [13.758578 127 us - 952 received] [14.771637 128 us - 952 received] [15.784697 129 us - 953 received] [16.797757 130 us - 955 received] ... [67.450714 180 us - 950 received] [68.463772 181 us - 954 received] [69.476831 182 us - 961 received] [70.489890 183 us - 941 received] [71.502949 184 us - 950 received] [72.516008 185 us - 941 received] [73.529068 186 us - 957 received] [74.542128 187 us - 956 received] [75.555187 188 us - 1000 received] [76.568248 189 us - 1000 received] [77.581310 190 us - 1000 received] [78.594371 191 us - 1000 received] [79.607431 192 us - 1000 received] [80.620493 193 us - 1000 received] [81.633554 194 us - 1000 received] [82.646615 195 us - 1000 received] [83.659676 196 us - 1000 received] [84.672737 197 us - 1000 received] [85.685798 198 us - 1000 received] [86.698859 199 us - 1000 received] [87.711920 200 us - 1000 received] We see that with setting RTC alarm to 120us we are guaranteed to not receive an interrupt. Starting from 188us we receive all interrupts. Results from 180us to 200us, 100k times: [107.697820 180 us - 95144 received] [208.997886 181 us - 95250 received] [310.297953 182 us - 95259 received] [411.598017 183 us - 95167 received] [512.898079 184 us - 95245 received] [614.198148 185 us - 95149 received] [715.498217 186 us - 95166 received] [816.798283 187 us - 95235 received] [918.098345 188 us - 100000 received] [1019.398414 189 us - 100000 received] [1120.698484 190 us - 100000 received] [1221.998555 191 us - 100000 received] [1323.298622 192 us - 100000 received] [1424.598695 193 us - 100000 received] [1525.898759 194 us - 100000 received] [1627.198827 195 us - 100000 received] [1728.498897 196 us - 100000 received] [1829.798961 197 us - 100000 received] [1931.099025 198 us - 100000 received] [2032.399095 199 us - 100000 received] [2133.699164 200 us - 100000 received] Again, we see that starting from 188us all interrupts are received. The new value was set to 200us, so we have 12us of safe margin. BUG=b:200828093 BRANCH=none TEST=Set HOOK_TICK_INTERVAL in chip/stm32/config_chip.h to value that is a sum of STOP_MODE_LATENCY, PLL_LOCK_LATENCY and SET_RTC_MATCH_DELAY and value between 50us to 100us (to give enough time to do context switches). For SET_RTC_MATCH_DELAY equal to 120us, good value is 400. For 200us, the value should be 450. Compile bloonchipper and flash it on dragonclaw development board. Make sure that there are no reboots caused by watchdog. TEST=./test/run_device_tests.py --board bloonchipper \ --flasher servo_micro --tests stm32f_rtc Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: Ica2036c142ac7fd792c6365b97cb39fab656d227 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3688190 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Bobby Casey <bobbycasey@google.com>
* zephyr: move Adlrvp USB mux configuration into the DTSTomasz Michalec2022-06-034-116/+31
| | | | | | | | | | | | | | | | | | | Move the Adlrvp board USB mux configuration into the devicetree. Remove USBC_PORT_Cx_BB_RETIMER_I2C_ADDR from zephyr/shim/include/config_chip.h since there is no platform in Zephyr that use these defines. BUG=b:229411952 TEST=zmake testall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I95b9fdf665c9e7aa56dae65116d6d0030e9549d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3607991 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: move Brya USB mux configuration into the DTSTomasz Michalec2022-06-032-3/+27
| | | | | | | | | | | | | | | | Move the Brya board USB mux configuration into the devicetree. BUG=b:229411952 TEST=zmake testall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I4a388caca7833391b76bb4261b64f30cf3b26ecc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3607990 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Sam Hurst <shurst@google.com>
* zephyr: Extend JHL8040R DTS node to support USB-C mux configurationTomasz Michalec2022-06-0312-96/+152
| | | | | | | | | | | | | | | | | | | JHL8040R is BB retimer. Add necessary changes to make it possible to configure BB retimer as USB-C mux using a devicetree. Add code to generate bb_controls array with entry for every BB retimer in USB-C muxes chain. Align adlrvp and brya DTS to new banding of JHL8040R. BUG=b:229411952 TEST=zmake testall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I339f09d5f259dea88c9a783290744162a94d9559 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3607989 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: move Nissa USB mux configuration into the DTSTomasz Michalec2022-06-039-65/+63
| | | | | | | | | | | | | | | | | Move Nissa boards (Nivviks, Craask, and Nereid) USB mux configuration into the devicetree. BUG=b:227757117 TEST=zmake testall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I988603bcc847ce9aae4fd0b86506659066577832 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3593790 Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Andrew McRae <amcrae@google.com>
* zephyr: Add ANX7483 USB-C mux DTS configurationTomasz Michalec2022-06-033-0/+50
| | | | | | | | | | | | | | | | Add necessary changes to make it possible to configure an ANX7483 USB-C mux using a devicetree. BUG=b:227757117 TEST=zmake testall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I3ecc3dc66d2269905b19f7b1db44db5d8ca6df3c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3593789 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: Add choice for TUSB type in KconfigTomasz Michalec2022-06-035-12/+34
| | | | | | | | | | | | | | | | | TUSB1064 USB-C mux driver can work only with one TUSB type at the same time. Allowed types are TUSB1064. TUSB1044, and TUSB546. It makes sense to introduce PLATFORM_EC_USB_MUX_TUSB_TYPE in Kconfig.usb_mux BUG=none TEST=zmake testall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I7bc583811bce718451d137f09dbe5f20be963f3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3579120 Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: shim: add single charge task supportFabio Baltieri2022-06-039-12/+109
| | | | | | | | | | | | | | | | | | | | | | | | Add an option to run the charger code in a single task. This is enabled by default in Zephyr builds, but explicitly disabled for a couple of platforms that currently have task dependent board code. Should be enough to start testing the configuration, will work on handling the remaining boards (corsola and nissa) later. BRANCH=none BUG=b:226411332 TEST=make buildall TEST=zmake testall TEST=cq dry run TEST=run on Brya, connect/disconnect usb devices Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I75a63f7b0a9545e6c824114de7f81b71924e0789 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3663748 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* kinox: update the charge manager infoMatt Wang2022-06-031-2/+14
| | | | | | | | | | | | | | | | | | | Modify the charge info for the host command EC_CMD_USB_PD_POWER_INFO can get which one type the adapter plugin then set the corresponding intel power limit parameters. The CHARGE_SUPPLIER_PROPRIETARY for TIO1 and TIO2. The CHARGE_SUPPLIER_DEDICATED for TINY. BUG=b:231911918 BRANCH=none TEST=The host can get the correct adpater type.(b:231911918#comment12) Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I801fba3a7630c77271abe6b07ebcf53734537d02 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3662863 Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* servo_updater: Add retries for flash2Yi Chou2022-06-031-2/+2
| | | | | | | | | | | | | A workaround for the remaining character in the USB buffer. BRANCH=None BUG=b:232156962 TEST=servo_updater -b servo_micro Signed-off-by: Yi Chou <yich@google.com> Change-Id: I0334172c0bc10d16201ff9c4d54d66c02ea283f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3688769 Reviewed-by: Brian Nemec <bnemec@google.com>
* nereid: bring charger out of LPM on S0 entryPeter Marheine2022-06-031-0/+47
| | | | | | | | | | | | | | This appears to fix VBUS sourcing, though we don't understand why. It may also prevent charger damage with as-yet-unexplained cause. BUG=b:231920135,b:230712704 TEST=VBUS sourcing works when AP is in S0 BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ia4d74f4211eb97b532882914d077e3dde5e59f64 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3686012 Reviewed-by: Andrew McRae <amcrae@google.com>
* tablet_mode: remove tablet command in clamshell systemarthur.lin2022-06-031-0/+2
| | | | | | | | | | | | | | | | | | | Remove console tablet mode command when undefine CONFIG_MKBP_INPUT_DEVICE and CONFIG_TABLET_MODE for wake source test. BUG=b:231930177 BRANCH=none TEST=make buildall -j TEST=on taniks, run test_that -b brya "IP" power_WakeSources can get pass result. TEST=on taeko/tarlo, run test_that -b brya "IP" power_WakeSources can get pass result. Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com> Change-Id: I678e404c46c061d67737165e77d885d6afd4eed3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3670655 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Parth Malkan <parthmalkan@google.com>
* zephyr: herobrine: Define battery-level property as int rangeParth Malkan2022-06-031-4/+8
| | | | | | | | | | | | | | | | Currently battery-level property is defined using enums. This patch changes this to use int range instead. BRANCH=None BUG=b:233953617 TEST=Manual test on Lazor by modifying nodes to include battery-level range, use battfake to set different levels and observe LED behavior. Cq-Depend: chromium:3669088 Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: I18ef922a41ce17d509f03a1774e9d9437fc7065d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3669089 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: LED: Define battery-level property as int rangeParth Malkan2022-06-034-24/+62
| | | | | | | | | | | | | | | | Currently battery-level property is defined using enums. This patch changes this to use int range instead. BRANCH=None BUG=b:233953617 TEST=Manual test on Lazor by modifying nodes to include battery-level range, use battfake to set different levels and observe LED behavior. Cq-Depend: chromium:3669089, chromium:3669090 Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: Idfe516addfe20d5141e5106afd338b49f10a6349 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3669088 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: skyrim: Define battery-level property as int rangeParth Malkan2022-06-031-2/+6
| | | | | | | | | | | | | | | | Currently battery-level property is defined using enums. This patch changes this to use int range instead. BRANCH=None BUG=b:233953617 TEST=Manual test on Lazor by modifying nodes to include battery-level range, use battfake to set different levels and observe LED behavior. Cq-Depend: chromium:3669088 Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: I502b7a85420b0c017494739a977c468fd009dfde Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3669090 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Replace power_get_state calls with chipset_in_statePeter Marheine2022-06-032-31/+13
| | | | | | | | | | | | | | | | | | | | The `power_get_state` function does not exist when using the Zephyr native power sequencing subsystem. Use the chipset_in_state family of functions instead, because those are available in either configuration. For PD power state change, this means S4 cannot be returned because chipset_in_state doesn't currently provide an option for S4 specifically. BUG=b:233681784 TEST=make buildall; zmake testall BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I14af373ec4473b0c19bf46ebae0c503e5139e114 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3685929 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Jameson Thies <jthies@google.com> Tested-by: Jameson Thies <jthies@google.com>
* kinox: Add control type-c adapter OBP methodMatt Wang2022-06-022-18/+102
| | | | | | | | | | | | | | | | | | | The barrel jack OBP method at CL:3521743, this CL add for type-c adapter. Use the charge manager info to get the adapter source capacity to set the OBP pointer then trigger PROCHOT. BUG=b:211806236;b:213955278 BRANCH=none TEST=Kinox can get the barrel(90w) type-c(65w/45w) adapter. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I3e1af004aa5e22ff61af06c89690237059cce00b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3644747 Commit-Queue: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* USB Mux: Set an event when AP mux sets completeDiana Z2022-06-022-0/+12
| | | | | | | | | | | | | | | | | The AP will need to know when its selected mux has finished setting. For now, most boards have at most one mux and one retimer, and so add events for each of those. BRANCH=None BUG=b:208882941,b:155889939 TEST=on nipperkin, set muxes via the AP console and view the corresponding events are set Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I52fcfe861f80e60bd01ab4bd610edb7cadf1e049 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3687080 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Add a host command to allow the AP to set muxesDiana Z2022-06-023-1/+55
| | | | | | | | | | | | | | | Add a sub-command onto the TYPEC_CONTROL command in order to permit the AP to set muxes and retimers. BRANCH=None BUG=b:208882941,b:155889939 TEST=on nipperkin, ensure muxes can be changed from ectool Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I08ed46474693ec09b1db155b469b83d4acec8fbb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3687079 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Ectool: Correct TYPEC_CONTROL switchDiana Z2022-06-021-0/+1
| | | | | | | | | | | | | | | | Add a "break" to the case for the enter mode command. Otherwise, it would fall through to the UFP policy state. BRANCH=None BUG=None TEST=on nipperkin, verify enter mode request is queued up (though not acted on, since AP driven mode entry isn't enabled) Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I2e93661110350d2df4566e4565c1d0dab5590447 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3687078 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>