summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cherry: disable PD logstabilize-14385.B-mainTing Shen2021-12-072-2/+1
| | | | | | | | | | | | | | | | | | | | We found that disabling *all* console outputs makes PD response time 30% faster. Since we can't disable all outputs, try to remove a few redundant things first. BUG=b:193753475 TEST=Measure the delay between Source_Cap and Request message. 15ms after this patch. BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I59047e9fb83eefe0f5d1c587401309dc2ffb7ef3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310298 Reviewed-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Rong Chang <rongchang@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* phaser: undef hibernate psl and keep KSI1/3 high in deep sleepreno.wang2021-12-072-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | It's workaround to reduce keyboard's "Silver Migration". From keyboard vendor's feedback, there are two factors to cause "Silver Migration". 1. A voltage potential between trace 2. The presence of an electrolyte , such as moisture. The reason cause voltage potential between KSIxx trace is EC enter ec hibernate PSL and turn EC's VCC1 power off. Besides KSI2, the other KSIxx will be turn off. KSI2 is powered by H1. To avoid voltage potential is keep KSI1, KSI2, and KSI3 on. That means not to enter ec hibernate PSL. BUG=b:203442963 BRANCH=None TEST=make -j BOARD=taeko, KSxx keep 3.3V under DC mode after calling system_hibernate(). Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: I44a99f9df22e6d21729540507b1947e12cc3189d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252568 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: use a chosen device for watchdog shimPeter Marheine2021-12-073-5/+4
| | | | | | | | | | | | | | This uses a chosen cros-ec,watchdog DT node to locate the watchdog device to shim, rather than assuming it is called twd0. BUG=b:205615358 TEST=zmake buildall BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Id6e2dcc8d75740797d6630134c0d4413ac7338ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3312504 Reviewed-by: Keith Short <keithshort@chromium.org>
* Dewatt: Fix board fw configSue Chen2021-12-071-17/+3
| | | | | | | | | | | | | | The C1 mux only use PS8818. All skus are convertible now. BUG=b:208167982, b:204347734 BRANCH=none TEST=Can initialize successfully C1 MUX PS8818 and motion sensors with empty fw_config. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I44dc387c50e0cb2c7f7dc4f99ff0fb8841143d52 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3315763 Reviewed-by: Rob Barnes <robbarnes@google.com>
* it8xxx2: Move non-core config to per-project configAndrew McRae2021-12-077-60/+62
| | | | | | | | | | | | | | | | | | Move non-base configuration from default it8xxx2 configuration to project level configuration: - keyboard enabling - keyboard scanning - wake mask - cros kb shim BUG=b:209324248 TEST=zmake configure -b {krabby,kinger} BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I9db3aab59f68602afdf5274a7eb4c9a77e778bf0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3316164 Reviewed-by: Sam Hurst <shurst@google.com>
* Dewatt: fix LED behavior for Ver1 boardSue Chen2021-12-071-8/+31
| | | | | | | | | | | | | | | Ver1 board: GPIOC4(PWM2) -> Blue LED GPIO80(PWM3) -> Amber LED BUG=b:208179462 BRANCH=none TEST=LED behavior is correct for all states. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I6f07b69119583675651a76cf9f0f67caff5afad1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3312918 Reviewed-by: Rob Barnes <robbarnes@google.com>
* Dewatt: Modify LED color and LED behavior definitionSue Chen2021-12-071-9/+10
| | | | | | | | | | | | | | | | | | | | | | Modify the color of EC_PWM_LED_FULL_L to blue, LED spec: Charging Amber on (S0/S3/S5) Full Charged Blue on (S0/S3/S5) Discharge in S3 Amber on 1sec, off 3sec Discharge in S5 Off Error Amber on 1sec, off 1sec Discharge in S0 Blue on Factory mode Blue on 2sec, Amber on 2 sec BUG=b:208179462 BRANCH=none TEST=LED behavior is correct for all states. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I9549c6b5c290b9d73fa9b18ec8d40480591c9a6e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3312516 Reviewed-by: Rob Barnes <robbarnes@google.com>
* AmptonE: Implement EC motion sensorMichael5 Chen12021-12-072-1/+77
| | | | | | | | | | | | | | | | Implement gyro sensor ICM42607 and lid sensor KX022. BUG=b:206526996 BRANCH=firmware-octopus-11297.B TEST=manual 1. watch ectool motionsense 2. watch ectool lid_angle Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Ib33d59dc359e1c4b189a6515ab6e31c5bc84e690 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3314480 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* redrix: Update charging LEDs behaviorDevin Lu2021-12-071-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | This patch updates the LEDs behavior. Change as below: 1. battery error: Original - Blinking white quickly. (0.5 sec ON, 0.5 sec OFF) New - Blinking amber quickly. (0.5 sec ON, 0.5 sec OFF) 2. battery low: Original - Blinking white slowly on right side led. (1 sec ON, 1 sec OFF) New - Blinking amber slowly on both side leds. (1 sec ON, 1 sec OFF) BUG=b:208912133 BRANCH=none TEST=Verify LEDs worked indeed. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I2ce233d57eb168b47d8dbcb724890e6e5f196f77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3314261 Commit-Queue: Boris Mittelberg <bmbm@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* bq257x0: Fix step size of minimum system voltagereno.wang2021-12-071-2/+2
| | | | | | | | | | | | | | | The step size of minimum system voltage for bq25710 is 256mv and bq25720 is 100mv. BRANCH=none BUG=b:209343612 TEST=buildall passes Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: I1b07a2a5122703046ef4158b6eae645c4861fdc0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3315766 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* gimble: Enable VCONN control on C1 (ps8815)Sugnan Prabhu S2021-12-071-1/+2
| | | | | | | | | | | | | | | | | This enables TCPC based VCONN control for port C1 (ps8815). BUG=None BRANCH=none TEST=TBT monitor detected on typec port 1 Signed-off-by: Sugnan Prabhu S <sugnan.prabhu.s@intel.com> Change-Id: I2f8beea567f5ff7e66d046aa5c539d7ab7bfcf2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306084 Tested-by: Abhijeet Rao <abhijeet.rao@intel.com> Reviewed-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com> Reviewed-by: Abhijeet Rao <abhijeet.rao@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: herbrine: move ppc replacement to a new fileDawid Niedzwiecki2021-12-064-21/+38
| | | | | | | | | | | | | | | | Move replacement of alternate devices, ppc in this case, to a new separate file. This will allow handling different chips based on board versions, cbi fields, etc. in one place. BUG=b:202451919 TEST=zmake testall & Make sure PD works on Herobrine on both ports BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I27fd01ee74523a18083f77a92c1051058cf7c814 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3289206 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: improve handling CBI SSFCDawid Niedzwiecki2021-12-063-20/+29
| | | | | | | | | | | | | | | | | | | The improvements include: -Use better names for SSFC related things. -Do not call checking SSFC and replacing alternate sensors automatically. Let the board-code call the replacement, since it is very specific operation. BUG=b:202451919 TEST=zmake testall & test if an alternate sensors are used as it is done in CL:3310639 BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I77a720d5b2ce09ea85902b681c5266d44eb6d144 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3289205 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: move probing of alt sensors to a functionDawid Niedzwiecki2021-12-065-126/+150
| | | | | | | | | | | | | | | | | | | Remove a function to probe all alternate motion sensors, but prepare a function to probe a specific sensor. It introduces more flexibility. Also, create a separated header file motionsense_sensors_defs.h with definitions needed in board.h. BUG=b:202451919 TEST=zmake testall & test if an alternate sensors are used as it is done in CL:3310639 BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ibfab10cbff39e17c8a86aad0c6d7c5897285a0a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3289415 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: herobrine: Update I2C bus labelsKeith Short2021-12-061-4/+6
| | | | | | | | | | | | | | | | | | | | The EC chip provides a default label for every I2C bus. Override the default label with a label matching the schematic net name. Typing "i2c scan <tab>" on Herobrine now shows the following labels: uart:~$ i2c scan I2C_SENSOR I2C_EEPROM I2C_RTC I2C_USB_C1_PD I2C_USB_C0_PD I2C_POWER BUG=none BRANCH=none TEST=Boot Zephyr on herobrine, verify the new I2C bus labels Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I41c4bfbffca5ee49b66d6ffbfc0a6d73ea06db8d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300665 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* zephyr: i2c: Remove label from named-i2c-portsKeith Short2021-12-0617-109/+1
| | | | | | | | | | | | | | | | | | | | | | The label property was stored in the name field of i2c_ports[]. However the name field is only used by the legacy I2C console commands and not used by Zephyr builds. Remove the label property from named-i2c-ports and remove the name field from i2c_ports[] for Zephyr builds, saving a modest amount of flash space. BUG=none BRANCH=none TEST=zmake testall TEST=Boot zephyr on Herobrine, verify I2C console commands still functional. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I22c743c4e362d05d51432fa67f5be16989d39574 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300664 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Quackingstick: fix orientation for accelgyro BMI160Sue Chen2021-12-061-2/+2
| | | | | | | | | | | | | | | | | | | Modify lid_standard_ref to 0, 1, 0 -1, 0, 0 0, 0, 1 BUG=b:208865381 BRANCH=none TEST=The display orientation is correct on the BMI160 board. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Ica254ebe7e805771f7a6a2514196a7123a7908d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3316163 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Bob Moragues <moragues@chromium.org> Commit-Queue: Bob Moragues <moragues@chromium.org>
* zephyr: herobrine: GPIOB6 and GPIOB7 config change.Sam Hurst2021-12-061-2/+8
| | | | | | | | | | | | | | | | | | For Herobrine board version 1, pin GPIOB7 is unused and GPIOB6 is configured as input (HiZ). BRANCH=main BUG=b:202008595 TEST=Built the Zephyr image. Needs testing when version 1 boards are available. Signed-off-by: Sam Hurst <shurst@google.org> Change-Id: Ia18dda97b65122ed768fe89f64f0857da4356b89 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3315752 Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Commit-Queue: Sam Hurst <shurst@google.com>
* zephyr: Disable DPTF on nivviksJeremy Bettis2021-12-062-0/+3
| | | | | | | | | | | | | | | | | | | | | Add a static assert to catch DPTF being used without temp sensors defined in the dts. Disable DPTF on nivviks. This fixes a build error on gitlab. https://gitlab.com/zephyr-ec/ec/-/pipelines/422163729 BRANCH=None BUG=b:201000681 TEST=zmake configure --build nivviks Change-Id: I273a7267783f119391d1d739c598ed2a059d1286 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3317781 Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* taeko: Correct base sensor's y/z axisreno.wang2021-12-061-3/+3
| | | | | | | | | | | | | | | | | | | In some angle, dut should keep clamshell mode, but change to tablet mode and lock keyboard because of wrong y/z axis setting. This CL is used to correct it. BRANCH=none BUG=b:201504044 TEST=make -j BOARD=taeko, verify base sensor's x/y/z via checking ectool motionsense. Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: Id3d48b184b7e20744961f4219bbae1be06136ddf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306765 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Parth Malkan <parthmalkan@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* gimble: revise battery LED behaviorWill Tsai2021-12-061-2/+2
| | | | | | | | | | | | | Modify LED behavior to meet the revised specification BUG=b:193600290 BRANCH=none TEST=make -j BOARD=gimble Signed-off-by: Will Tsai <will_tsai@wistron.corp-partner.google.com> Change-Id: I3961b8083d30e582320cad1e4852746367e9a0a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3312514 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* zephyr: battery: add SMP L20M3PG2Eric Yilun Lin2021-12-063-0/+55
| | | | | | | | | | | | | | | Add SMP L20M3PG2 battery. BUG=b:203739613 TEST=zmake testall BRANCH=none Change-Id: I86c39e5cbe3a9b9aed19781d30528e3f43effcf5 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3312506 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
* pazquel: change panel blacklight PWM frequency to 20kTang Qijun2021-12-051-3/+2
| | | | | | | | | | | | | | | | | | | The noise is related to the LCD panel and brightness PWM. Change the PWM frequency of the panel backlight to 20kHz, the display is normal, and no noise can be heard. BUG=b:207585489 BRANCH=trogdor TEST=No noise can be heard when booting into the operating system, and the screen display is normal. Signed-off-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com> Change-Id: I2ba8f7530743bbd1ee6f462be8f79c621eb3217a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3301560 Commit-Queue: Bob Moragues <moragues@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* zephyr: Use a different way of handling no host commandsSimon Glass2021-12-041-7/+13
| | | | | | | | | | | | | | | | | When CONFIG_PLATFORM_EC_HOSTCMD is not enabled we want to silently drop the handler routines from the build. The current approach works for gcc but not for clang. Use an exported function instead. BUG=b:208648337 BRANCH=none TEST=CQ and gitlab Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I63f74e8081556c726472782f60bddbbfbc3e9bf0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3313320 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* docs: Add Zephyr New Board checklistKeith Short2021-12-042-0/+121
| | | | | | | | | | | | | Add the initial new board checklist for Zephyr ECs. BUG=b:207403708 BRANCH=none TEST=View docs using gerrit preview/browse Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I1e2585709eaf9b1f9db4f57c9ae665797b3e5608 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3296745 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr test: Verify SYV682x busy bit checkAbe Levkoy2021-12-033-0/+67
| | | | | | | | | | | | | | | | Support setting CONTROL_3[BUSY] in the SYV682x emulator. Verify that writes fail if this bit stays set for too long but succeed if it clears quickly. BUG=b:190519131 TEST=zmake configure --test zephyr/test/drivers BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I58386f73c8df20239b3eaf13f8eab37be0b11bbf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3315225 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* drawcia: Don't report HDMI_HPD to CPU when power state S5Tommy Chung2021-12-031-3/+32
| | | | | | | | | | | | | | | | | | | | Since PP5000_HDMI is enabled by EN_PP5000_U, which means that it's still turned on when power state S5, VOLUP_BTN_ODL_HDMI_HPD will be asserted when HDMI is plugged in. If we report this to CPU through EC_AP_USB_C1_HDMI_HPD, there will be leakage current on CPU side which might lead to unabling to power on the system. BUG=none BRANCH=dedede TEST=make sure that EC_AP_USB_C1_HDMI_HPD is deasserted when power state S5 and HDMI plugged in, while it can work when system resume. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I67d1af60b74343611e0ca6f54773216cf4caa895 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306791 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: pm: npcx: add pm constraint check in PM policyJun Lin2021-12-031-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | In PR:40802, the UART driver uses the pm_constraint counter to indicate if the UART Tx is still ongoing or not. The pm policy should check the counter with the pm_constraint_get function to determine if the system can enter the suspend state or stay in the active one. BUG=none BRANCH=none TEST=pass "zmake testall" TEST=build npcx9_evb and volteer with PR:40802, make sure they can boot up and enter deep sleep. Make sure the console messages don't break. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com> Change-Id: I0803d9bb8454825a7ae876abaac58c65e7db1550 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306790 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: brya: backlight lid configuration cleanupRajesh Kumar2021-12-031-2/+0
| | | | | | | | | | | | | | | | | | Fix conflicting configuration for backlight lid. CONFIG_PLATFORM_EC_BACKLIGHT_LID will be enabled by default, no need to enable explicitly, removing this from prj.conf. BUG=b:208787653 BRANCH=none TEST=zmake configure -B ~/tmp/brya/ brya -b Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Change-Id: Ia44ae2c51b913817b1b7ac31aa1cb16ef623aa27 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3313322 Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* scarlet: Enable LTOJack Rosenthal2021-12-031-1/+1
| | | | | | | | | | | | | | | Scarlet is tight on flash space and enabling LTO buys us a a bunch space (~10 KB). BUG=b:208889220 BRANCH=none TEST=RO: 9996 bytes in flash and 10772 bytes in RAM still available RW: 21916 bytes in flash and 10764 bytes in RAM still available Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ifec28beadc94971f951c86b9ae3504e6f0aada0a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3313650 Reviewed-by: Evan Green <evgreen@chromium.org>
* nissa: Add ADC channels for nivviksAndrew McRae2021-12-033-1/+29
| | | | | | | | | | | | | | | | Add ADC channels for temperature sensors for nivviks. BUG=b:201000681 TEST=zmake configure -b nivviks BRANCH=none Cq-Depend: chromium:3310024 Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I2c4e8da3a3902934f8fbeea46723dad42f479630 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3312809 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: drivers: Switch usb_mux test to FFFTomasz Michalec2021-12-031-213/+343
| | | | | | | | | | | | | | | Use FFF framework instead of ztest_* API in usb_mux test. BUG=none BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I6c42f8f60d0b4bfb5a852e53539ffb9fb9424b10 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306363 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Tristan Honscheid <honscheid@google.com>
* it8xxx2: Move the AP SoC configuration to the project configuration.Andrew McRae2021-12-032-4/+4
| | | | | | | | | | | | | | Move the AP SoC default configuration out of the base Zephyr it8xxx2 board to the project configuration. BUG=b:208739197 TEST=zmake configure -b krabby; zmake configure -b kingler BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Ia111f6ab592d0782902f91cd70ebfc7693c4a398 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3312511 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: drivers: Extend BUILD_HOST_COMMAND macroTomasz Michalec2021-12-034-27/+30
| | | | | | | | | | | | | | | | | | | | | | | | | Now BUILD_HOST_COMMAND macro accepts params argument to setup parameters of host command. New variants of BUILD_HOST_COMMAND are added: - BUILD_HOST_COMMAND_RESPONSE - BUILD_HOST_COMMAND_PARAMS - BUILD_HOST_COMMAND_SIMPLE They allow to declare host command with only response, params or neither. The response_size field is intentionally set to 0, because this is default value. Command returning data should update this field. BUG=none BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I31021db3790dfa3e0ad15128daf455d14a9c071c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310858 Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: brya: Enable ADC runtime configurationRajesh Kumar2021-12-032-0/+6
| | | | | | | | | | | | | | | | | Enable CONFIG_ADC_CHANNELS_RUNTIME_CONFIG for brya and fixed compilation error in zephyr shim. BUG=b:208785542 BRANCH=none TEST=zmake configure -B ~/tmp/brya/ brya -b Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com> Change-Id: I69e89091aece1125d499f192a6124bf5277b8def Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3313321 Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* nissa: Initial zephyr config for nivviksAndrew McRae2021-12-038-0/+408
| | | | | | | | | | | | | | | | | Initial EC Zephyr config for Nissa/Nivviks. Not all GPIOs have been defined yet. V2 - reworked to use a single project directory. V3 - renaming. BUG=b:201000681 TEST=make -j buildall; cd zephyr; zmake configure -b nivviks BRANCH=none Cq-Depend: chromium:3312397 Change-Id: I2b3f7ee77dc8365fac10b8fb7a4eec65d827bed1 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310024 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: use a chosen device for eSPI shimPeter Marheine2021-12-034-9/+8
| | | | | | | | | | | | | | | Rather than assume the eSPI controller the ECOS shim should bind to is called espi0, instead get a chosen cros-ec,espi device at build-time. BUG=b:205615358 TEST=zmake testall BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I46f43494e64af0550c4f54f716a63d16a1f96651 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3312503 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: use a chosen DT node to find ADC devicesPeter Marheine2021-12-034-5/+8
| | | | | | | | | | | | | | | | | | This change adds a cros-ec,adc chosen node to the device tree, to be used by the ADC shim to locate the device to which all analog channels are bound (rather than assuming it is named adc0). It also makes the configuration happen at compile-time, saving some runtime indirection and failing faster (at build rather than runtime) if misconfigured. BUG=b:205615358 TEST=zmake testall BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I71bdf7329b76eb4cda06478f27bb76418e6b0b78 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3308335 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* USB MUX: Wait on ACK for HPD changes when requiredDiana Z2021-12-0233-47/+154
| | | | | | | | | | | | | | | In order to correctly sequence HPD sets with the AP, allow the HPD set to wait on an ACK from the AP before proceeding. BRANCH=None BUG=b:202137658 TEST=on brya, validate retimer and virtual mux are kept in sync as expected Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I368c3290b69d627829a70847876d7b47a8c36948 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3232293 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: test: sn5s330 verify set_sbu functionAaron Massey2021-12-021-0/+28
| | | | | | | | | | | | | Verify the sn5s330 driver set_sbu api correctly sets registers. BRANCH=none BUG=b:203364783 TEST=zmake configure --test test-drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I4a63d8c093653829d4fe46de193a0bd7f571ae3c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3311881 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Cut over to the main branchJack Rosenthal2021-12-022-8/+3
| | | | | | | | | | | | | | | | | | | | Tell zmake to search for the checkout path of the main branch (see the dependencies) instead of the v2.7 checkout path. Update the GitLab configuration to download main instead of chromeos-v2.7. BUG=b:205884929 BRANCH=none TEST=zmake testall TEST=https://gitlab.com/zephyr-ec/ec/-/pipelines/420535963 Cq-Depend: chrome-internal:4299651 Change-Id: Ie7a2b7784606d0fc2455dab3c21ec3b49f073b06 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310534 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Shim nct38xx io expander alertWealian Liao2021-12-025-7/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zephyr upstream added NCT38XX GPIO support except for TCPC functionality. The NCT38XX GPIO & TCPC share the same alert pin. The alert should be handled at the same position. This CL adds nct38xx_get_gpio_device_from_port() for Cros NCT38XX alert handler. It can connect Cros TCPC alert & Zephyr NCT38XX GPIO alter handler. So we can process the GPIO & TCPC alert at Cros task. The following is the TCPC binding example: usbc { compatible = "named-usbc-ports"; #address-cells = <1>; #size-cells = <0>; port0: usbc-port@0 { reg = <0>; tcpc { compatible = "nuvoton,nct38xx"; gpio-dev = <&nct3807_gpio>; }; }; }; BUG=b:203672150 BRANCH=none TEST=test GPIO interrupt on NCT38XX Cq-Depend: chromium:3297249 Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Iec355ccb581590d24cc9fcc809449b3654014a40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3271801 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* nissa: Add new enum bindings for nivviksAndrew McRae2021-12-023-0/+5
| | | | | | | | | | | | | | Add new zephyr enum bindings for new GPIOs for nivviks. BUG=b:201000681 TEST=make -j buildall BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I5fa334c461d4c11e3618199e31e6db2754a88d46 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3312397 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Fix console buffer characters collectingTomasz Michalec2021-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Console buffer should write chars at location of tail index and then increment index, not otherwise. It fixes reading buffer before first buffer overwrite (start condition with empty buffer is head_idx == 0 and tail_idx == 0, first char was written to index 1 not 0, so uninitialized char at index 0 (head_idx) could be read). It fixes not reading last char by EC_CMD_CONSOLE_READ host command. Empty buffer condition is head_idx == tail_idx. It was impossible to read last char if it was pointed by tail_idx. Because of that tail_idx should point past last written char. BUG=none BRANCH=none TEST=make configure --test zephyr/test/drivers TEST="ectool console" on volteer; logs usually ends with newline; after this change extra newline should be printed (last char in buffer) Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I056b95533580db3724897d04d8863a78e73c2b2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310857 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* brask: Set SYV682X HV_ILIM to 5.5ADavid Huang2021-12-021-0/+2
| | | | | | | | | | | | | | Set CONFIG_SYV682X_HV_ILIM to 5.5A on brask. BUG=b:207810000 BRANCH=none TEST=Use i2cxfer check syv682x setting. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: Ice496d7065af33576cb06880e05aac1c52f598a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310027 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Eric Herrmann <eherrmann@chromium.org>
* taeko: enable PD_PREFER_LOW_VOLTAGEreno.wang2021-12-021-0/+3
| | | | | | | | | | | | | | | Enable PD_PREFER_LOW_VOLTAGE to select PDO which is lower voltage if there are two PDOs with same max power. It can have higher power efficiency. BUG=b:208394216 BRANCH=None TEST=make -j BOARD=taeko Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: I61348f44a5ec7798dfbf94914f40a0fc4e280998 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3247511 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* zephyr: kconfig: add RT1718S PPC/TCPC configEric Yilun Lin2021-12-023-1/+41
| | | | | | | | | | | | | | | Add PLATFORM_EC_USBC_PPC_RT1718S, and PLATFORM_EC_USB_PD_TCPM_RT1718S. BUG=b:203739613 TEST=zmake testall BRANCH=none Change-Id: I663bbb29f38dfc925675a6f1beddeb3c976722fe Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310017 Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* bugzzy : change LCD MAX current setting on MP3372YongBeum.Ha2021-12-022-1/+3
| | | | | | | | | | | | | | | | In order to meet the specification of LCD brightness, it is necessary to set the current value of the LCD controller. BUG=b:202344727 BRANCH=None TEST=make -j BOARD=bugzzy Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I3299707fdb653cd1c28494781307972ee750c6b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306770 Reviewed-by: Henry Sun <henrysun@google.com> Commit-Queue: Henry Sun <henrysun@google.com>
* redrix: tcs3400: update coeffs for als and rgb sensorIsaac Lee2021-12-021-19/+19
| | | | | | | | | | | | | | | | | | | Update board files for redrix to use new coefficients for als and rgb sensor. BUG=b:196313037 BRANCH=main TEST='make -j BOARD=redrix' in EC repo, verified builds succeed. Change-Id: I1d90a414daecec24f5139a7acb8150e195166502 Signed-off-by: Isaac Lee <isaaclee@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3268040 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-by: YH Lin <yueherngl@chromium.org> Tested-by: Fang (Annabelle) Liu <afliu@google.com> Tested-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: YH Lin <yueherngl@chromium.org>
* elm: Enable LTOJack Rosenthal2021-12-021-0/+1
| | | | | | | | | | | | | | | | Enabling LTO buys us about 10K of flash, which will probably hold out this board on ToT for much longer. BUG=b:208691054 BRANCH=none TEST=RO: 10176 bytes in flash and 8768 bytes in RAM still available RW: 18308 bytes in flash and 8768 bytes in RAM still available Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I7c10e10d8bc9aa7b4f86c70909974a16334fa905 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3311885 Commit-Queue: Evan Green <evgreen@chromium.org> Reviewed-by: Evan Green <evgreen@chromium.org>