summaryrefslogtreecommitdiff
path: root/board
Commit message (Collapse)AuthorAgeFilesLines
...
* ec: Change get_keycap_label return to unsignedJeremy Bettis2023-01-063-9/+9
| | | | | | | | | | | | | | | | | | | | | | This causes compiler failures with some compiler flags. Change all references to get_keycap_label to use uint8_t instead of char. BRANCH=NONE BUG=b:264434836,b:257393779 TEST=make clobber && make V=1 TEST_ASAN=y TEST_FLAG=TEST_HOSTTEST=y \ test-list-host=kb_8042 run-kb_8042 LOW_COVERAGE_REASON=Refactor of types only. Change-Id: I95db81e8adc2bc082df8fae26d33aad78adbd1cf Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4136957 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com> Code-Coverage: Eric Yilun Lin <yllin@google.com>
* marasov: Modify I2C frequence for i2c2/i2c6.Michael5 Chen12023-01-061-2/+2
| | | | | | | | | | | | | | | | | Depend on SYV682 datasheet, modify i2c frequecny to 400KHz. BUG=b:263831228 BRANCH=non TEST=manual Run command "ectool i2cspeed 2" and "ectool i2cspeed 8", and check i2c frequency. Change-Id: I9918715545794040bcb0ecda3a39eb6c3de868ea Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4127576 Reviewed-by: Kyle Lin <kylelinck@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Kyle Lin <kylelinck@google.com>
* marasov: Modify thermal policyMichael5 Chen12023-01-051-66/+20
| | | | | | | | | | | | | | | | Modify thermal policy depend on theraml team request. BUG=b:264217345 BRANCH=none TEST=manual Thermal team verify is passed. Change-Id: Ibe92b3be3521bb443934054ffa43269d3f0fd142 Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4127634 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Kyle Lin <kylelinck@google.com> Commit-Queue: Kyle Lin <kylelinck@google.com>
* terrador: Disable i2cscan to create flash spaceDaisuke Nojiri2023-01-051-0/+2
| | | | | | | | | | | | | BUG=None BRANCH=None TEST=build Change-Id: I6185a60842526d24409804da1f63cc50df72ce09 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4136967 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* tree: Replace "unsigned" with "unsigned int"Andrea Grandi2023-01-042-4/+4
| | | | | | | | | | | | | | | | | Fix checkpatch error: > Prefer 'unsigned int' to bare use of 'unsigned' BUG=b:262047616 TEST=./util/compare_build.sh -b all -j 120 => MATCH BRANCH=none Change-Id: Ibf82332a1e1ea0a0a03d3993336e24883e495e05 Signed-off-by: Andrea Grandi <agrandi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4126483 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* gaelin: Apply PS8811 tuning parametersBruce Chiang2022-12-211-2/+15
| | | | | | | | | | | | | Applying tuning parameters recommended by retimer vendor. BUG=b:262806983 TEST=i2cxfer to read setting is correct. BRANCH=None Change-Id: I9dcd01c0a77d6d9986642e6aaa0aa195b4a07cfd Signed-off-by: Bruce Chiang <brucechiang@msi.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4087965 Reviewed-by: Derek Huang <derekhuang@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* gladios: Update fw_config for gladiosHank.Xie2022-12-192-24/+28
| | | | | | | | | | | | | | | | Update fw_config to meet gladios's fw_config table. BUG=b:243859089 BRANCH=none TEST=make BOARD=gladios Change-Id: I0e1299330841b982f43a18f3b01a00bbdd9109c6 Signed-off-by: Hank.Xie <hank.xie@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060803 Commit-Queue: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Devin Lu <devin.lu@quantatw.com>
* gladios: Update board config for gladiosHank.Xie2022-12-199-530/+99
| | | | | | | | | | | | | | | | | | | | | Update all configs to meet gladios's board: 1. Update USBC related config (including switching from 3 ports to 1 port, changing TCPC/USBC mux to RT1715/PS8818, removing TBT) 2. Update I2C ports 3. Update gpio config 4. Remove peripheral charger BUG=b:239513596 BRANCH=none TEST=make BOARD=gladios Signed-off-by: Hank.Xie <hank.xie@quanta.corp-partner.google.com> Change-Id: Ie208196c78396c54df7721f1022d2850bac9f9cf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060802 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Devin Lu <devin.lu@quantatw.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Commit-Queue: Ricky Chang <rickytlchang@chromium.org>
* marasov: Remove TBT functionMichael5 Chen12022-12-194-63/+5
| | | | | | | | | | | | | | | | Not support TBT, remove TBT function BUG=b:259002141 BRANCH=none TEST=make BOARD=marasov 1. Check EC console log. Change-Id: I2cc8c994e37f81473b43bf68576aed1fa325bcd3 Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4059937 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Kyle Lin <kylelinck@google.com>
* {ambassador,genesis,moonbuggy,scout}: Increase fan to reduce throttling.Richard Yeh2022-12-178-80/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chromebox for Meetings (CfM) devices are videoconferencing appliances. Discovering that a significant fraction of our fleet was throttling the CPU due to temperature, resulting in bad video quality, we have decided that these devices should never throttle. The present change reduces the temperature thresholds at which we increase fan speeds. For most of the time, when the CfM is idle, we expect no or little change in fan speeds. During calls, the CfM CPU can exceed 60 C, and the sensors controlling the fan are typically 10-20 degrees C cooler than the CPU, so we set the maximum-fan temperature to 50-55 C in an attempt to arrest any temperature increase before the CPU reaches throttling temperatures. We add fan tables to enable hysteresis in the fan speed setting. Fan RPMs are chosen to span the min-to-max range, while avoiding 50 Hz and 60 Hz line frequencies. fizz and kalista boards are shared with non-CfM versions, while the other boards are CfM-only. Since those boards are several years old, we plan to build these firmware changes only into CfM-branch releases, not all fizz and kalista devices. Additional details at go/cfm-overheating . Temperature traces with load testing on both top-of-tree and firmware with this change are shown at go/cfm-overheating#heading=h.ykpzxotgnu2j BRANCH=update-fan-tables BUG=b:252966838,b:191187610,chromium:1383859 TEST=Confirmed validity of settings with `ectool thermalset`. Built firmware, flashed to endeavour and excelsior (fizz), verified that fan turns on earlier. This does not completely prevent throttling from 47.25 W to 15.00 W on Kaby Lake boards (endeavour, fizz, kalista), but it does prevent dropping below 15.00 W. Comet Lake boards (ambassador, genesis, moonbuggy, scout) start at 15.00 W and rarely throttle anyway. Signed-off-by: Richard Yeh <rcy@google.com> Change-Id: I7f23583ca1b85d3b8b9da43918880f68b41538c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060610 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Redrix: Enable RF charge for stylusDaisuke Nojiri2022-12-161-0/+2
| | | | | | | | | | | | | | | | RF charge gives a stylus wrongly detected as a foreign object a chance to recover. BUG=b:245764044 TEST=Redrix. Verify a test stylus recovers from memory corruption and continue to charge normally. BRANCH=None Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I778a3c8e6016803d3af1e4f380fccae04e7758ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4093114 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: Add test for std::chrono::system_clockTom Hughes2022-12-152-0/+2
| | | | | | | | | | | | | | BRANCH=none BUG=b:234181908, b:254530679 TEST=./test/run_device_tests.py --board bloonchipper -t libcxx TEST=./test/run_device_tests.py --board dartmonkey -t libcxx Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I86753187a5d3e7e363fd1a8d9f89e61b42cd8521 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4062465 Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Bobby Casey <bobbycasey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* redrix: derate charger current by 6%Boris Mittelberg2022-12-151-0/+2
| | | | | | | | | | | | | | | Measurements taken in b/260774380 indicated excessive current draw. Fixing this by derating the current as many other boards do. BRANCH=none BUG=b:260774380 TEST=manual Change-Id: I8bd151d5d686e4f80015e45adb12fb0864053c84 Signed-off-by: Boris Mittelberg <bmbm@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4109116 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* marasov: Implement keyboard and keyboard backlight functionMichael5 Chen12022-12-143-8/+38
| | | | | | | | | | | | | | | | | | | | | 1. Depend on keyboard matrix, implement keyboard function. 2. Modify keyboard backlight config depend on fw_config. BUG=b:261915212 BRANCH=none TEST=manual 1. Check all key by evtest. 2. Check Function key behavior. 3. Check keyboard backlight function. (FW Config bit 0 set 0/1) 3.1. Alt + Bright up/down 3.2. Check EC GPIO EC_KB_BL_EN_L status Change-Id: I7fd561e0475c59ac5221be78a1f76b49cb2d974d Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4085108 Reviewed-by: Kyle Lin <kylelinck@google.com> Commit-Queue: Kyle Lin <kylelinck@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Banshee: Set 'DP CONNECTION' bitjohnwc_yeh2022-12-141-4/+48
| | | | | | | | | | | | | | | | | | | | | | | Set 'DP CONNECTION' bit when mux_state gets HPD event only on the ports with HDMI/DP card It will increase BBR power consumption, so set 'DP CONNECTION' bit only when mux_state gets HPD event only on the ports with HDMI/DP card. BUG=b:233975818 BRANCH=None TEST=make BOARD=banshee,test on Banshee, when only hdmi card 'DP CONNECTION' bit is 0. Enter console command bb 1 r 4 =0x403, plug in hdmi monitor bb 1 r 4 =0x8503. Change-Id: Ibe4f3d7fec6349d4033113f7340139dee8736aff Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4082508 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* marasov: modify fw_config settingMichael5 Chen12022-12-132-24/+18
| | | | | | | | | | | | | | | Modify FW_CONFIG setting. BUG=b:256374573 BRANCH=none TEST=make BOARD=marasov Change-Id: I4b0c174048abb331fa3c96388f9026769e4e0ae4 Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4090782 Commit-Queue: Kyle Lin <kylelinck@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Kyle Lin <kylelinck@google.com>
* endeavour: Increase fan to reduce throttling.Richard Yeh2022-12-131-57/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chromebox for Meetings (CfM) devices are videoconferencing appliances. Discovering that a significant fraction of our fleet was throttling the CPU due to temperature, resulting in bad video quality, we have decided that these devices should never throttle. The present change reduces the temperature thresholds at which we increase fan speeds. For most of the time, when the CfM is idle, we expect no or little change in fan speeds. During calls, the CfM CPU can exceed 60 C, and the sensors controlling the fan are typically 10-20 degrees C cooler than the CPU, so we set the maximum-fan temperature to 50-55 C in an attempt to arrest any temperature increase before the CPU reaches throttling temperatures. We add fan tables to enable hysteresis in the fan speed setting. Fan RPMs are chosen to span the min-to-max range, while avoiding 50 Hz and 60 Hz line frequencies. fizz and kalista boards are shared with non-CfM versions, while the other boards are CfM-only. Since those boards are several years old, we plan to build these firmware changes only into CfM-branch releases, not all fizz and kalista devices. Additional details at go/cfm-overheating . Temperature traces with load testing on both top-of-tree and firmware with this change are shown at go/cfm-overheating#heading=h.ykpzxotgnu2j BRANCH=update-fan-tables BUG=b:252966838,b:191187610,chromium:1383859 TEST=Confirmed validity of settings with `ectool thermalset`. Built firmware, flashed to endeavour and excelsior (fizz), verified that fan turns on earlier. This does not completely prevent throttling from 47.25 W to 15.00 W on Kaby Lake boards (endeavour, fizz, kalista), but it does prevent dropping below 15.00 W. Comet Lake boards (ambassador, genesis, moonbuggy, scout) start at 15.00 W and rarely throttle anyway. Signed-off-by: Richard Yeh <rcy@google.com> Change-Id: I3719b6828411bda4e0c1efde58065ef2cf35ceea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060609 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* fizz: Increase fan to reduce throttling.Richard Yeh2022-12-131-84/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chromebox for Meetings (CfM) devices are videoconferencing appliances. Discovering that a significant fraction of our fleet was throttling the CPU due to temperature, resulting in bad video quality, we have decided that these devices should never throttle. The present change reduces the temperature thresholds at which we increase fan speeds. For most of the time, when the CfM is idle, we expect no or little change in fan speeds. During calls, the CfM CPU can exceed 60 C, and the sensors controlling the fan are typically 10-20 degrees C cooler than the CPU, so we set the maximum-fan temperature to 50-55 C in an attempt to arrest any temperature increase before the CPU reaches throttling temperatures. We add fan tables to enable hysteresis in the fan speed setting. Fan RPMs are chosen to span the min-to-max range, while avoiding 50 Hz and 60 Hz line frequencies. fizz and kalista boards are shared with non-CfM versions, while the other boards are CfM-only. Since those boards are several years old, we plan to build these firmware changes only into CfM-branch releases, not all fizz and kalista devices. Additional details at go/cfm-overheating . Temperature traces with load testing on both top-of-tree and firmware with this change are shown at go/cfm-overheating#heading=h.ykpzxotgnu2j BRANCH=update-fan-tables BUG=b:252966838,b:191187610,chromium:1383859 TEST=Confirmed validity of settings with `ectool thermalset`. Built firmware, flashed to endeavour and excelsior (fizz), verified that fan turns on earlier. This does not completely prevent throttling from 47.25 W to 15.00 W on Kaby Lake boards (endeavour, fizz, kalista), but it does prevent dropping below 15.00 W. Comet Lake boards (ambassador, genesis, moonbuggy, scout) start at 15.00 W and rarely throttle anyway. Change-Id: I4eb532977677fbfd939fc46f851948cd4adf9788 Signed-off-by: Richard Yeh <rcy@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4004441 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Revert "dratini: Set TCPC_AUX_SWITCH to 0xC on Port 0 on CCD enable"Boris Mittelberg2022-12-133-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 515990a91e4430ff66cae9e532332a0ee33162de. Reason for revert: Doesn't work if rddkeepalive is enabled Original change's description: > dratini: Set TCPC_AUX_SWITCH to 0xC on Port 0 on CCD enable > > When the screen brightness is changed, DP sends signal on AUX channel. > This causes CCD mode to be disconnected. > > This patch sets the MUX to aux+ <-> sbu2, aux- <-> sbu1 to fix it. > > Same change as I3dba1bdfd44a921077a2f60dec17119bb0077238 > > BUG=b:183123775 > BRANCH=none > TEST=manually verify servod doesn't exit when screen brightness is changed > > Signed-off-by: Boris Mittelberg <bmbm@google.com> > Change-Id: Iff91a4b4753b42ee42cd5baac36ba8243d966ce0 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2785192 > Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Bug: b:183123775 Change-Id: I6b72f8b0e7d5242c26721ad9024899f697a2da72 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4098336 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Auto-Submit: Boris Mittelberg <bmbm@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Tested-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Mary Ruthven <mruthven@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* lisbon: Update fw_config for lisbonTommy Chung2022-12-122-24/+28
| | | | | | | | | | | | | | | | Update fw_config to meet lisbon's fw_config table. BUG=b:248786948 BRANCH=none TEST=make BOARD=lisbon Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I51388f4c896e37584716f979b99f275b589e6f66 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4019705 Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Commit-Queue: Ricky Chang <rickytlchang@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Devin Lu <devin.lu@quantatw.com>
* lisbon: Update board config for lisbonTommy Chung2022-12-129-526/+99
| | | | | | | | | | | | | | | | | | | | Update all configs to meet lisbon's board: 1. Update USBC related config (including switching from 3 ports to 1 port, changing TCPC/USBC mux to RT1715/PS8818, removing TBT) 2. Update I2C ports 3. Update gpio config 4. Remove peripheral charger BUG=b:246657849 BRANCH=none TEST=make BOARD=lisbon Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Ifaf869462025d35a30d6e2bf65e0083419dbdc39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3934441 Commit-Queue: Ricky Chang <rickytlchang@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* test: Add a test for global object initializationTom Hughes2022-12-102-0/+2
| | | | | | | | | | | | | | BRANCH=none BUG=b:261636413 TEST=./test/run_device_tests.py -b dartmonkey -t global_initialization => Fails without https://crrev.com/c/4081571 Cq-Depend: chromium:4081571 Change-Id: Ic92a5e92538c22d81d769d0f26be65abe0905656 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4083114 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Andrea Grandi <agrandi@google.com>
* board/hyperdebug: Name pins after connector positionJes B. Klinke2022-12-092-75/+36
| | | | | | | | | | | | | | | | | | | | | | | Even pins that default to a special purpose such as UART or SPI, can be reconfigured at runtime to be used as GPIO. In order to support that case, they have been renamed according to their connector position, like all the other pure GPIO pins. Also, initialize SPI controller at board boot, rather than when host first requests SPI operations via USB. This is in preparation for the HyperDebug board supporting the re-configuration of SPI speed, or individual pins as SPI or GPIO, at any point in time, either before or after the host has initiated USB SPI communcation. BUG=b:254554329 TEST=Observe ability to use UART pin as GPIO Change-Id: I5d1879369a9cc0dde0f84de1cf83429669ca1469 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4089985 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* board/hyperdebug: Allow runtime pin reconfig to alternateJes B. Klinke2022-12-091-2/+4
| | | | | | | | | | | | | | | | The HyperDebug board is versatile like uServo. This change allows pins which are by default used for UART, SPI, etc. to also be used as GPIO for a while, and then reconfigured back to their special purpose. BUG=b:254554329 TEST=Observed HyperDebug GPIO on UART pin, then revert Change-Id: Iabaed0fc622f208e8d50560ebcb95399594fbc53 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4089451 Commit-Queue: Jes Klinke <jbk@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* chips/stm32/usb_spi: Forwarding to multiple spi devicesJes B. Klinke2022-12-095-5/+6
| | | | | | | | | | | | | | | | For devices similar to Servo Micro, in case of multiple entries in spi_devices, this change allows the USB host to request which device its transaction requests are to be forwarded to. BUG=b:192262089 TEST=HyperDebug board forwards to two SPI busses Change-Id: Ic94e66a8d7f5502c3016a26a1beb24236b3c4893 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4077428 Commit-Queue: Jes Klinke <jbk@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* test: Add timer testAndrea Grandi2022-12-072-0/+2
| | | | | | | | | | | | | | | | | Verify the existing usleep() function in preparation for moving its implementation into the builtin folder. BUG=b:260723169 TEST=test/run_device_tests.py -b bloonchipper -t timer TEST=test/run_device_tests.py -b dartmonkey -t timer TEST=make run-timer BRANCH=none Change-Id: I532fa5ac7abf7b16b4d1a86ea5e961f08fb2f1b7 Signed-off-by: Andrea Grandi <agrandi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4068487 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* zephyr: move usbc interrupt handler to shimJason Yuan2022-12-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | various board specific TCPC interrupt handler have been moved into tcpc.c in shim. ports are now automatically configured from the i2c dts instead of hardcoded. this does not remove the handler binding from interrupts.dts or initialize the interrupt from the driver, which will be added in a followup CL. stub test handler in test/.../stubs.c has been removed and existing tests have been modified to use new tcpc driver. BUG=b:256996124 TEST=twister, usbc charging on lazor BRANCH=none Signed-off-by: Jason Yuan <jasonyuan@google.com> Change-Id: Iac05907f3c286f26329dac7f99730396d23b1166 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4024013 Commit-Queue: zhi cheng yuan <jasonyuan@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Sam Hurst <shurst@google.com> Commit-Queue: Sam Hurst <shurst@google.com> Auto-Submit: zhi cheng yuan <jasonyuan@chromium.org> Tested-by: zhi cheng yuan <jasonyuan@chromium.org>
* gladios: Initial EC imageTommy Chung2022-12-0515-0/+2123
| | | | | | | | | | | | | | | | | | Create the initial EC image for the gladios variant by copying the brask reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.5.0). BUG=b:239513596 BRANCH=None TEST=make BOARD=gladios Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I6af21a20a3044a371882e0bc644e6aea86558bdf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022082 Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* gaelin: Add USB-A retimer supportRaymond Chung2022-12-024-0/+59
| | | | | | | | | | | | | | | Initialize PS8811 retimer for USB-A0 and USB-A1. Print an error if retimer does not respond to i2c read. BUG=b:237517617 BRANCH=None TEST=PS8811 is detected on the console. Change-Id: I7f7bf9f6cb030141bc5de6018353b8ffb6d11686 Signed-off-by: Raymond Chung <raymondchung@ami.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060626 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* board: Sort header filesJeremy Bettis2022-12-01503-1070/+1193
| | | | | | | | | | | | | | | | | | | | Sort all includes in board with the clang-format rules used by the zephyr project. BRANCH=None BUG=b:247100970 TEST=zmake build -a TEST=./twister --clobber -v -i TEST=make -j72 buildall_only runtests TEST=zmake compare-builds -a Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I6ad72b167cbb768a64c338fa633eb4bf5a401897 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060360 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* board/burnet: Free up flash spaceTom Hughes2022-11-291-0/+3
| | | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=burnet Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: If04c6b209990822ccad384a1a6cbd66870eefcaa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4024564 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* Rename CONFIG_CHARGER_INPUT_CURRENT to _CHARGER_DEFAULT_CURRENT_LIMITPeter Marheine2022-11-2918-18/+20
| | | | | | | | | | | | | | | | | | | "Default input current" is not a very clear name, so rename this option to better express its use as a default value that is set in the charger. This is made possible by splitting other uses into CHARGER_MIN_INPUT_CURRENT_LIMIT, making the only use for CHARGER_INPUT_CURRENT be as a default. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=isl9241 and sm5803 currently lack emulators Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ia9c1df9061825b15477466e85343afeb2a371288 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4025404 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* moli: add power on/wakeup by HDMI monitorElsie Shih2022-11-283-6/+129
| | | | | | | | | | | | | | | | | | | After EC received interrupt from monitor on GPIOB4/ GPIOB5/ GPIO10. EC will power on the system. If EC received interrupt during s0ix, EC will trigger powr button to wake AP. BUG=b:239634608 BRANCH=none TEST=make BOARD=moli Signed-off-by: Elsie Shih <elsie_shih@wistron.corp-partner.google.com> Change-Id: Ia407468afc103595d33b6ce526d8e05bc66c76a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3771361 Tested-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* dibbi: Update board specific power implementationLiam Flaherty2022-11-288-677/+336
| | | | | | | | | | | | | | | | | | | | | | Removed battery and battery charging support, as dibbi does not have either of these. Added support for dual barrel-jack/USB-C power supplies and update USB PD policies accordingly. Added support for USB-C0 output load-switch. Made changes in dedede baseboard to allow alternate implementation of extpower_is_present with the absence of a charger chip. BUG=b:257377326 BRANCH=dedede TEST=make -j BOARD=dibbi Signed-off-by: Liam Flaherty <liamflaherty@chromium.org> Change-Id: I81d01a88caf174eb038685bf098686e8a310a9b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4054386 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Sam McNally <sammc@chromium.org> Reviewed-by: Adam Mills <adamjmills@google.com> Tested-by: Adam Mills <adamjmills@google.com>
* gaelin: Keep backlight and speaker power control for displayRaymond Chung2022-11-251-2/+8
| | | | | | | | | | | | | | | | | This change adds to keep backlight and speaker always on to unlock proto 2 power on validation. We'll keep following on it to figure out the correct behavior for backlight/speaker power control and implement in EC. BUG=b:249000573, b:259321814 BRANCH=None TEST="make -j BOARD=gaelin" and normal display. Change-Id: Id4c60a26f74957e57c5ea4230f70ea02660236ed Signed-off-by: Raymond Chung <raymondchung@ami.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4043947 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Derek Huang <derekhuang@google.com> Commit-Queue: Derek Huang <derekhuang@google.com>
* magolor: delay one second when charger enter low power modeben chen2022-11-241-0/+2
| | | | | | | | | | | | | | add delay one second waiting for charger enter low power mode BUG=b:259155418 BRANCH=none TEST=checking ec console don't power on until enter hibernate Change-Id: I56b5e1f84f32dc4dea69b0c53b45980cb9b741e7 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4050016 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* marasov: use default board_set_charge_limit implementationPeter Marheine2022-11-241-7/+0
| | | | | | | | | | | | | | | The brya baseboard already configures the minimum current limit suitable for use with the default implementation. Delete the copy from this board. BUG=b:163093572 TEST=make buildall BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I84a0ddae7d46e70913f7d9b6753cd134bae19072 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4055000 Reviewed-by: Kyle Lin <kylelinck@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* marasov: Modify TypeC and TypeA configuration.Michael5 Chen12022-11-249-253/+56
| | | | | | | | | | | | | | | | | | | Depend on design, 1. Remove BC1.2 (USB_CHARGE, CHARGER_RAMP). 2. Remove TypeC port 2. 3. Change PPC to SYV682 for typeC port 1. 4. Support 2 USB TypeA ports. BUG=b:259002141,b:255184961 BRANCH=none TEST=make BOARD=marasov Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I8dbd75ffc8666b8931ef0e486e6e6a3ba6ac0c56 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022557 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Kyle Lin <kylelinck@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Add default implementation of board_set_charge_limitPeter Marheine2022-11-24105-529/+82
| | | | | | | | | | | | | | | | | | | The majority of boards simply call charge_set_input_current_limit() from board_set_charge_limit() now that the minimum current limit and derating are available as config options. Make this the default behavior of the charge manager, overridable by boards as needed. Boards that have existing custom behavior retain it, with their versions of board_set_charge_limit() marked as __override as necessary. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I72475ca0e8381596cafbcda4b042c7f884ae0432 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022857 Reviewed-by: Keith Short <keithshort@chromium.org>
* Add CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMITPeter Marheine2022-11-23108-207/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits the dual use of CONFIG_CHARGER_INPUT_CURRENT into two different symbols, changing the uses of that which are used to set a minimum current limit to be CONFIG_CHARGER_MAX_INPUT_CURRENT_LIMIT. Most boards implement this in the same way within either the board or baseboard, so handling of the new option is moved into charge_set_input_current_limit (which is called by every user of the option) and every board which repeated this pattern has the new symbol set to the same value as the old one, with the duplicated code deleted. One functional change to the charge manager is made: when charging stops, the input current limit is set to the default value (CONFIG_CHARGER_INPUT_CURRENT) rather than 0. This captures the intent that the default current is appropriate at any time, which was previously configured by individual boards' implementation of board_set_charge_limit() while still allowing the limit to be set lower as needed. To verify that all changes are appropriate, the following has been manually checked: * All boards with a change to a .c file also have a .h change * All boards without a changed .h file have a changed baseboard.h * For Zephyr projects, those with a changed .c file have config added for the minimum limit and others (only corsola) are unchanged to leave it off. This is intended to verify that each board that duplicated the MAX() logic has its configuration updated to use the shared copy, and that boards with that code in the baseboard also update their configuration. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=added lines will soon be deleted Change-Id: Ia460a16293c1fb82aac3784fd9be57ba0985f2fe Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4019703 Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* moli: separate fw_config from the board.*Elsie Shih2022-11-235-43/+130
| | | | | | | | | | | | | | | | | - Add power on by monitor config - Re-locate barrel-jack power config BUG=b:239767485, b:241207167 BRANCH=none TEST=make BOARD=moli Signed-off-by: Elsie Shih <elsie_shih@wistron.corp-partner.google.com> Change-Id: I4b5f3f6599817069a6f1bdb633bdd9e4a1a34241 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3993602 Reviewed-by: Boris Mittelberg <bmbm@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Tested-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* driver/retimer/ps8818.h: Add I2C ADDR FLAGS 0x30, 0x58, 0x70Tommy Chung2022-11-222-2/+2
| | | | | | | | | | | | BUG=b:259354679 BRANCH=none TEST=make buildall -j Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Ia93b7fb6c927e2d527186e0d59d3e37da01ed820 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4001240 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* marasov: Modify the EC battery settingMichael5 Chen12022-11-222-3/+1
| | | | | | | | | | | | | | | | 1. Remove CONFIG_BATT_HOST_SHUTDOWN_PRECENTAGE to default. 2. Modify voltage_normal value depend on b:259008193#3 BUG=b:259008193 BRANCH=none TEST=make BOARD=marasov Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I14c05eadfcc2e923273014dbfd18fc2946711208 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4037122 Reviewed-by: Kyle Lin <kylelinck@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* pirika: fix index checkBoris Mittelberg2022-11-191-1/+1
| | | | | | | | | | | | | | Fix port bound check to avoid out-of-bound access BUG=b:64477774 BRANCH=none TEST=make -j buildall Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I3571a42ef38adf3a49395c08344182908e479b43 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4032283 Reviewed-by: caveh jalali <caveh@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* pompom: dead code eliminationBoris Mittelberg2022-11-192-31/+13
| | | | | | | | | | | | | | Pompom has only one type-c port, remove the unnecessary loops. BUG=b:64477774 BRANCH=none TEST=make BOARD=pompom Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I3a9197ecd6f66d591b20baf10231db226ad4dad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4035430 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Add CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCTPeter Marheine2022-11-17126-270/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many boards derate their charge current limits by some fixed ratio, which results in duplicate code appearing in many different boards. Since nearly all of these are in implementations of board_set_charge_limit() and themselves call charge_set_input_current_limit(), make that derating a config option and move it into charge_set_input_current_limit(). This makes most boards' implementations uniform and ripe for further simplification in later changes. For those boards that do more complex adjustments, those can be retained by keeping the existing logic in board_set_charge_limit(). Several boards also uselessly defined multiple versions of board_set_charge_limit(): the redundant ones are removed. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=follow-up CLs delete uncovered code Change-Id: I0a7162e72538a91ad06ba85b91a10b93eb6af96b Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4015966 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* board/hyperdebug: USB serial numberJes B. Klinke2022-11-161-0/+22
| | | | | | | | | | | | | | | Make the HyperDebug board present non-empty USB serial number. The serial number is computed based on a factory programmed register, in a manner that attempts to exactly replicate what the STM DFU ROM bootloader does. BUG=b:258237976 TEST=Observed USB serial on two HyperDebug boards Change-Id: Ic55de3f736ffb1ecab419658ad08423371845699 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4028741 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Tested-by: Jes Klinke <jbk@chromium.org>
* board/corori2: Free up flash spaceTom Hughes2022-11-161-0/+3
| | | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=corori2 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I788d367b3ad8ae5d40574da31b844cbb08db1fe4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4029518 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Edward Hill <ecgh@chromium.org>
* marasov: Config the EC battery setting.Michael5 Chen12022-11-162-44/+19
| | | | | | | | | | | | | | | Config the EC battery setting depend on battery spec. BUG=b:259008193 BRANCH=brya TEST=make BOARD=marasov Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I04a6e3d96780cbffd44b83f6453d40bb577564eb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022611 Reviewed-by: Kyle Lin <kylelinck@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Kyle Lin <kylelinck@google.com>
* marasov: Implement the EC LED codeMichael5 Chen12022-11-164-115/+83
| | | | | | | | | | | | | | | Implement the EC LED code dependent on spec. BUG=b:259006557 BRANCH=brya TEST=make BOARD=marasov Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I57b857b6a509105eb8360957d14c5330ab6035fb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022612 Reviewed-by: Kyle Lin <kylelinck@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Kyle Lin <kylelinck@google.com>