summaryrefslogtreecommitdiff
path: root/baseboard/guybrush/baseboard.c
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-051-894/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* guybrush: move thermal sensor/setting to variantZick Wei2021-09-071-151/+0
| | | | | | | | | | | | | | | | | This patch move thermal sensor and setting to variant, let variant have their own setting. BUG=none BRANCH=none TEST=make BOARD=dewatt, make BOARD=guybrush, make BOARD=nipperkin Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ibf37a0a45d1a728abc5ed88dde230f0561698bbc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3132547 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* adc: Remove adc_chip.h where adc.h is usedCaveh Jalali2021-08-271-1/+0
| | | | | | | | | | | | | | This removes the use of adc_chip.h where adc.h is also used. In this case, adc_chip.h is redundant. BRANCH=none BUG=b:181271666 TEST=buildall passes Change-Id: Id7baf9aef949447a4d47934242f9bae97c971262 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120317 Reviewed-by: Keith Short <keithshort@chromium.org>
* Guybrush: Flag that retimers will power off in G3Diana Z2021-08-261-0/+2
| | | | | | | | | | | | | | | | Both retimers for guybrush will power off in G3, so flag them as such. This is only functionally relevant to the ANX retimer, since it starts up in USB mode by default, but is true for both. BRANCH=None BUG=b:195045790 TEST=on guybrush, power down to G3 and then power back up and ensure retimer is turned off Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ia23051ba65b232179cd3b7b3d7c1710487dcd5d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095019 Reviewed-by: Rob Barnes <robbarnes@google.com>
* guybrush: Enable AMD STTRob Barnes2021-08-251-1/+1
| | | | | | | | | | | | | | | | Enable AMD STT driver. The AMD STT driver will read the SOC and ambient temperature sensors every second and send the result to the SOC via SB RMI on the i2c bus. BUG=b:176994331 TEST=stt debug BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I45157acf172dcce00c24971be70c5ec609d460dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3082326 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* tmp112: Support reading TMP112 in millikelvinRob Barnes2021-08-251-1/+1
| | | | | | | | | | | | | | | TMP112 supports .0625 degrees of resolution. Retain this resolution and support reading the temp in degrees millikelvin. BUG=b:176994331 TEST=Build and run on guybrush BRANCH=None Change-Id: I2802016b1edb08678953238e7f01acdd320c37cf Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3001391 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* USB MUX: Generalize mux ACKDiana Z2021-08-141-2/+6
| | | | | | | | | | | | | | | | | | | | Currently, only the virtual mux driver uses the mux ACK feature, but the actual wait for the host command ACK is a part of the usb_mux general code. Generalize this mux ACK wait so it's available if needed in the future for more muxes. Additionally, moving this wait out of the mux set will allow us to lock the muxes intelligently between tasks, without keeping the muxes locked during the inactive ACK wait. BRANCH=None BUG=b:172222942,b:186777984 TEST=tast typec.Mode*.manual on voxel Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I61a043425a482cc6f3170548c888d91ec20c2a82 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078411 Reviewed-by: Keith Short <keithshort@chromium.org>
* nct38xx: Split after-reset timestabilize-14151.B-mainDevin Lu2021-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Split after-reset time for NCT3807 and NCT3808, since the after-reset time is not the same. From the datasheet (section 4.4.2 Reset Timing) as following: * | Min | Max | * ----------------------+-------+-------+ * NCT3807 (single port) | x | 1.5ms | * ----------------------+-------+-------+ * NCT3808 (dual port) | x | 3ms | * ----------------------+-------+-------+ Currently the after-reset time for NCT3807 is zero. Change to 2ms to fit specification as well. BUG=none BRANCH=none TEST=On Redrix. Initial success with NCT3807. TEST=On Dirinboz. Initial success with NCT3807. TEST=make buildall. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I1f47f57c0d8955946b1c2522e1a1736739217f41 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3068492 Reviewed-by: caveh jalali <caveh@chromium.org>
* guybrush: Move Motion and ANX CONFIG flags to guybrushBhanu Prakash Maiya2021-08-121-3/+0
| | | | | | | | | | | | | | | | Motion sensor are only supported in guybrush convertible designs. Parade retimer is currently used by guybrush reference and OEM board. ANX flags are only required in guybrush reference board. BUG=b:194031783 BRANCH=None TEST=make BOARD=nipperkin make BOARD=guybrush Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Change-Id: Ia84f8396510ad833d033bb6743e22bbbdc4d5204 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088587 Reviewed-by: Diana Z <dzigterman@chromium.org>
* keyboard: Use __override for keyboard_scan_configDaisuke Nojiri2021-07-231-1/+1
| | | | | | | | | | | | | | | | | Currently keyboard_scan_config is defined by each board using CONFIG_KEYBOARD_BOARD_CONFIG. This patch makes it defined as __override hence removes CONFIG_KEYBOARD_BOARD_CONFIG. BUG=None BRANCH=None TEST=buildall Change-Id: I53a356741ba4d00e829ca59b74ee6dc704188728 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3044403 Tested-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* guybrush: Use correct index for tmp112 SOCRob Barnes2021-07-211-1/+1
| | | | | | | | | | | | | | | This change fixes a bug where ADC_TEMP_SENSOR_SOC index was used in for the TMP112 SOC instead of TMP112_SOC BUG=b:176994331 BRANCH=None TEST=Check output of temps Change-Id: Ic27e38f5d4dfee3b270fe8490787575cf4cc7568 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002883 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* Guybrush: Sleep the battery fuel gauge before hibernatingDiana Z2021-07-141-0/+4
| | | | | | | | | | | | | | | Before we go into hibernate, try to put the battery fuel gauge into sleep mode. Note we must be in a low current state for the gauge to actually enter this mode. BRANCH=None BUG=b:186774653 TEST=on guybrush, observe power reduction in Z5 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ie02aa3ede1b3a89592bdd5cd8e701887db3c2d9f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2967039 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Guybrush: Switch to TCPC sourcing detectionDiana Z2021-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Both PPC drivers used by guybrush report Vbus sourcing through a set of cached flags. However, with FRS in the picture their flags will no longer accurately reflect whether we're sourcing. The TCPC however will correctly report that we're sourcing in its power control register. This should also be a more reliable source of information when the system is resetting or sysjumping. It no longer seems necessary to confirm that a port is not sourcing before performing a power supply reset, so this has been removed as well. BRANCH=None BUG=b:183586640 TEST=on guybrush with FRS enabled, perform a failed FR swap and see that Type-C ErrorRecovery correctly turns off Vbus. Perform a successful FR swap and ensure we don't have a lingering Vbus supplier in the charge manager. With no battery, boot from both ports with only a charger plugged in. Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I7833f52dc84e2d5b097c4deb6acf7f2c29b8d48a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2987597 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Guybrush: Reset TCPCs in dead battery mode after charger removalDiana Z2021-06-221-0/+10
| | | | | | | | | | | | | | | | | | | When we're requested to set our charge port to None, indicating our previous charge port was either removed or switched to no longer being a sink role, reset any TCPCs which were in dead battery mode. This does not provide any increased risk of brown out, since we already lost our active charge port and would disable both board PPCs. BRANCH=None BUG=b:183660105 TEST=on guybrush, cut off the battery and boot with a charger. Remove the charger and ensure the TCPC is fully reset after removal Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I0538b179075cbcc35f00f9710151183413dea2fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2970785 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* Guybrush: Protect against simultanteous sinkingDiana Z2021-06-171-1/+27
| | | | | | | | | | | | | | | | | | | | When the NCT3807 boots in dead battery mode, it may neglect to drive its EN_SNK line until reset. This commit prevents us from changing charge ports when we're in dead battery boot and there's insufficient power to withstand Vbus loss. When there is enough power, we'll reset the dead battery TCPC before enabling sinking on the new charge port. This will cause an interruption to the PD connection on the original port, which would manifest in loss of USB and DP connections. BRANCH=None BUG=b:183660105 TEST=on guybrush, confirm we can switch ports with sufficient battery charge and do not pass through voltage from one port to the other Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: If4512c9a5dee162af41d03fef9979d760f4b1a95 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2953877 Reviewed-by: Rob Barnes <robbarnes@google.com>
* Guybrush: Notify NCT38xx driver after resetsDiana Z2021-06-171-11/+17
| | | | | | | | | | | | | | | | Add a notification to the NCT38xx driver once a port has been reset. Also make the port reset function knowledgable about the parameters it needs so it can be more easily used elsewhere. BRANCH=None BUG=b:183660105 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I2ac1cf50d8a82129f4a930b4984b9f2edac83b11 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2953876 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* guybrush: Add PS8811 driverRob Barnes2021-06-141-3/+2
| | | | | | | | | | | | | | | Add PS8811 USB A retimer driver. Reusing USB mux structure even though the retimer does not have a mux. BUG=b:176987937 TEST=Build and run BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Ie11a105f344e6acc1312cda517fdfe54ecb8c8ea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2946307 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Add fan thresholds to CPU temp sensorRob Barnes2021-06-111-2/+6
| | | | | | | | | | | | | | | If the SOC temp sensor fails for any reason, the CPU temp sensor should be used as a backup to trigger the fan. Mostly guessing on thresholds here. These values should be adjusted during thremal tuning. BUG=b:190831599 TEST=Disable SOC sensor, see fan trigger when CPU temp reached 60 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I6f95dccd07bc588e629b8447be3149edaf2611e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2956830 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Reuse USB mux structure for USBA retimersRob Barnes2021-06-111-17/+43
| | | | | | | | | | | | | | | Reuse the USB mux structure for USB A retimers. These retimers do not have an internal mux, so many fields do not apply. This change makes it simpler to create generic methods. BUG=None TEST=Build and run BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Idb2eef25bdd820febb18ef3b7af48c21f4c545d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2946306 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Guybrush: Add ambient temperature sensorDiana Z2021-06-071-0/+10
| | | | | | | | | | | | | | | Add the ambient temperature sensor which is being placed on the board in version 2. Note this will return an error on version 1 boards. BRANCH=None BUG=b:188539950 TEST=make -j buildall; load on version 1 and observe temps reports 0 for ambient temperature and nothing is spewing errors Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I5c1abffc716c758334cb923c0a34a7ec467ff565 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2938046 Reviewed-by: Rob Barnes <robbarnes@google.com>
* Gyubrush: Add TMP112 SOC sensor for board version 2Diana Z2021-06-071-0/+7
| | | | | | | | | | | | | | | | Add the TMP112 sensor which will be placed by the SOC and replaces the SOC ADC temperature input. BRANCH=None BUG=b:188539950 TEST=make -j buildall; load onto guybrush version 1 and verify temps read correctly Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ic70d3c56e22f4e1f4343ab3f41191b46f66d2e65 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2938045 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* guybrush: Only enable fan PWM in S0Rob Barnes2021-05-241-1/+1
| | | | | | | | | | | | | | The EC_FAN_PWM# pull up in S0 power domain. So restrict fan control to when S0_PGOOD is asserted. BUG=b:188534598 TEST=Build and run, fan still works BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Ifd4a6405004aef1628c1b272bfce2de7a4b8d8d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2906293 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Disable SOC_TEMP for board_version > 1Rob Barnes2021-05-241-8/+1
| | | | | | | | | | | | | | | | SOC_TEMP is being replaced with i2c temp sensor in board version 2. Disable SOC_TEMP so it doesn't cause thermal trips on board version 2. Move board_get_soc_temp to board level since variants will not need this logic. BUG=b:188540408 TEST=Boot guybrush, see SOC temp is correct BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I8880b74993d0a942894f1c06346c534d1f39466d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2906314 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Add CBI utility functionsRob Barnes2021-05-211-14/+0
| | | | | | | | | | | | | | | | | Add CBI utility functions. All values are cached. cbi_init prints the values and initializes the cache. Each function will also opportunistically initialize the cache in case it's accessed before cbi_init. BUG=None TEST=Boot guybrush, see CBI values printed BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I3e21a6792f4f0897019872201b2392f634c134ef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2906313 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Alias kb backlight gpioRob Barnes2021-05-191-2/+0
| | | | | | | | | | | | | | | | When keyboard backlight is 0%, the backlight led driver should be disabled to save power. By aliasing this GPIO, the common keyboard_backlight handler will toggle this GPIO on kblight_enable. BUG=b:187757151 TEST=Set backlight to 0, 50, 0 and observe the enable gpio is 0, 1, 0 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I22b0bb31720e9e17e9d896759be6b2ccf8c69d42 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2887551 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* Guybrush: Modify thermal_params and fan_rpmOwen_Ou2021-05-171-11/+21
| | | | | | | | | | | | | | | | | | | | | | Modify Guybrush's thermal_params in SoC and memory. Add Guybrush's thermal_params in CPU. And also modify Guybrush's fan_rpm BUG=b:187236086 BRANCH=none TEST=Change SoC and memory and CPU temperature value look ec console trigger evet in thermal program. And use ec console's 'fanduty' and 'faninfo' look fan's rpm Signed-off-by: Owen_Ou <Owen_Ou@compal.corp-partner.google.com> Change-Id: I3a89d8c02a21b342c13e9c2cbe571d0cc76af10d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2886472 Tested-by: Owen Ou <owen_ou@compal.corp-partner.google.com> Tested-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Auto-Submit: Owen Ou <owen_ou@compal.corp-partner.google.com> Commit-Queue: Owen Ou <owen_ou@compal.corp-partner.google.com>
* Guybrush: Correct temperature indexesDiana Z2021-05-051-3/+3
| | | | | | | | | | | | | | | | | | | The temp_sensor index should indicate the "index among the same kind of sensors." In the case of thermistors, this will be directly used as the ADC index to read from. Note that this is a no-op for guybrush, because the adc_channel indexes already aligned with the temp_sensors indexes. BRANCH=None BUG=b:187183867 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ia316a8985271cfc2af070ad351a0aba94703dc2a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2870539 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* Guybrush: Move batteries to board levelDiana Z2021-04-301-55/+0
| | | | | | | | | | | | | | | | Move battery information into the board level in anticipation of them probably varying with each board. BRANCH=None BUG=b:186577625 TEST=make -j buildall, load on guybrush with trembyle battery and ensure it's identified Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I1780949746cd30c3033b2c9f36d1ba8f5d331166 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2861055 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* guybrush: Start G3_TO_PWRBTN_DELAY_MS after RSMRST_LRob Barnes2021-04-271-2/+11
| | | | | | | | | | | | | | | G3->S0 timing requires 16 ms between RSMRST_L deasserting and PWRBTN asserting. This change waits for RSMRST_L to deassert before starting the G3_TO_PWRBTN_DELAY_MS delay. BUG=b:183038598 TEST=Time delay in G3_TO_PWRBTN_DELAY_MS is accurate scope catpures. BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I37de47229665597acbb857d9a8537f99be6a3f0b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2854336 Reviewed-by: Diana Z <dzigterman@chromium.org>
* thermisor: move header to include dirDawid Niedzwiecki2021-04-221-1/+1
| | | | | | | | | | | | | | | | Move the "thermistor.h" header to the include/driver/temp_sensor directory. It is used by the Zephyr shim, so the change is useful to include the header. BUG=b:180403276 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0e83df97e50a3b324440b65ddb900ddf135f2439 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2843323 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* guybrush: Fix ANX7451 driverRob Barnes2021-04-121-2/+2
| | | | | | | | | | | | | | | | | | Correct i2c address of ANX7451 on guybrush. Do not attempt to read or write mux in Z1 since mux is not powered. The only required init step is to disable ultra low power. So init can be removed if ultra low power is always set inside set. Prevent disabling both DP and USB at the same time since this causes mux to fail. BUG=b:184907521, b:184908498 TEST=Display port works on Guybrush B2 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Icdcc2df6034680844635c8b8675402d0825f34a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2816306 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Guybrush: initial BMI160 sensorMatt_Wang2021-04-121-0/+3
| | | | | | | | | | | | | | | | | Initial base BMI160 sensor. BUG=b:178213305 BRANCH=none TEST=make -j BOARD=guybrush TEST=can read the sensor data in ec console by i2cxfer. Signed-off-by: Matt_Wang <Matt_Wang@compal.corp-partner.google.com> Change-Id: Id49ff98dc921ba173b24f3c389fcfbde337ce77c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2783514 Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* guybrush: Dynamically configure C1 muxRob Barnes2021-04-091-78/+41
| | | | | | | | | | | | | | | | | Two C1 muxes are currently supported for guybrush. Configure the correct C1 mux at runtime based on fw_config. Move board_c1_ps8818_mux_set to guybrush board.c since it's board specific tuning. BUG=b:184548806 TEST=Build and run on guybrush B2 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I6ff809a9cbd1ddc2a408d2ce84f75d6723b7844f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809259 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Initialize A1 retimersRob Barnes2021-04-091-0/+71
| | | | | | | | | | | | | | | | Initialize PS8811 or ANX7451 A1 retimer. Print error if retimer does not respond to i2c read. Wait for 20 ms because ANX7451 retimer is slow to start. Add callbacks for board level tuning. BUG=b:184548806 TEST=ANX7451 detected on Guybrush B2 PS8811 detected on Guybrush B1 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I95370fd642d892d342ee5abc78c7f2a1599f78c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809882 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Add guybrush fw_configstabilize-glibc-13901.B-mainRob Barnes2021-04-081-0/+16
| | | | | | | | | | | | | | | | Each guybrush variant may have a different fw_config schema. Defining a schema agnostic fw_config interface at baseboard. Each guybrush variant must implement the interface. Fields that are not applicable outside a specific variant do not need to be exposed in the baseboard interface. BUG=b:178215011 TEST=Build and run on Guybrush B2 BRANCH=None Change-Id: I41d24ffddfc41d3148ba6d3685f728f6ec962919 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2722982 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Set fan_off threshold to 0Rob Barnes2021-03-241-1/+2
| | | | | | | | | | | | | | Set fan off threshold to 0 to ensure fan is always running SOC is on. This is a helpful visual and audible signal during bringup. BUG=b:183544852 TEST=Turn on soc at 33C and see fan on BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Ia552508132d42cfb332cc012431ebb68b3cefbc0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2783602 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Remove CPU temp from thermal_paramsRob Barnes2021-03-241-11/+1
| | | | | | | | | | | | | | | | CPU temp is hotter than SOC temp. The CPU thermal params have not been tuned. High CPU temps is causing shutdowns. Removing CPU temp from thermal_params and relying on SOC temp. BUG=b:183561584 TEST=Build and run BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I2d4b5483b88adefb83a7f1f8c6ea0e810f04153f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2783601 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Add 200ms delay between rsmrst and pwrbtnRob Barnes2021-03-161-8/+5
| | | | | | | | | | | | | | | | | Changing from 80ms to 200ms to allow more time for signals to settle before pwrbtn. This delay is not documented in spec, so this may require further tuning. BUG=b:182802230 TEST=Build BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I79432b05c11c520fd49cb84c8e575f253b04a836 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2764972 Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Add fan supportRob Barnes2021-03-161-0/+30
| | | | | | | | | | | | | | | Add basic fan support. More tuning will be needed. BUG=b:178217015 TEST=Build BRANCH=None Change-Id: I8133bfeb63346a254d0300d99d2b0ade35f74cc6 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2762804 Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* Guybrush: Enable Power Group interruptsstabilize-13851.B-mainelmo_lan2021-03-131-0/+4
| | | | | | | | | | | | | | Enable interrupt of PG_GROUPC_S0_OD and PG_LPDDR4X_S3_OD. BUG=b:182581653 BRANCH=None TEST=EN_PWR_PCORE_S0_R works normal. Signed-off-by: elmo_lan <elmo_lan@compal.corp-partner.google.com> Change-Id: I06ece39630b3f4eab290a80a64b9f70a8f61cac0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757809 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* Guybrush: Don't read GPIO_EN_KB_BL as ioexRob Barnes2021-03-121-2/+2
| | | | | | | | | | | | | | GPIO_EN_KB_BL is being read as an ioexpander gpio. This was true on Zork but on Guybrush it's a regular EC GPIO. BUG=None BRANCH=None TEST=Build Change-Id: I1ced4ebbb8c5cbd2dfca0e12528dfcb8fa47f789 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2755194 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: add current monitor adc signalsRob Barnes2021-03-091-1/+14
| | | | | | | | | | | | | | Add the two current monitor signals from the PCORE. These will only be used for debugging. BUG=None TEST=Build BRANCH=None Change-Id: I9d25fa263cd4ef9526a8c493a703d020672338c5 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2740560 Reviewed-by: Diana Z <dzigterman@chromium.org>
* COIL: Rename ioexpander i2c address variableDiana Z2021-02-241-2/+2
| | | | | | | | | | | | | | Rename ioexpander i2c address to match current conventions and update any calling locations. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iddad457f73d0dd0167496b794c00e274f8985615 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697855 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* guybrush: Don't read memory temp in G3Rob Barnes2021-02-161-1/+9
| | | | | | | | | | | | | Memory thermistor is connected to S5 rail. BUG=b:179065659 BRANCH=None TEST=Build Change-Id: I5c412d6c473defae9088251db50cf23b098e2bc2 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2692868 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Configure FP6 USB Muxes for C0 and C1Rob Barnes2021-02-041-3/+133
| | | | | | | | | | | | | | Only PS8818 is supported with this change. Support for ANX74xx will be added later. BUG=b:178713079 BRANCH=None TEST=Build Change-Id: I60b58395001f258896612e9c3efa0a03c5d455bc Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2654388 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: Configure keyboardRob Barnes2021-01-251-1/+48
| | | | | | | | | | | | | | | Configure keyboard based on zork. Enable keyboard tasks. Enable pwm for keyboard backlight. BUG=b:178213641 BRANCH=None TEST=Build Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Iae9d31c9849a3500dbd000829bd1439901a6d1b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2645076 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: hookup temp_sensors read functionRob Barnes2021-01-191-8/+13
| | | | | | | | | | | | | | | | get_temp_3v3_30k9_47k_4050b matches the voltage and resistance used in guybrush. Memory and charger thermistors are powered when EC is powered. SOC thermistor is not powered in G3 so an extra function is needed to guard against this case. BUG=None BRANCH=None TEST=Build Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I471d840c0442a022260c7e04704b46b8dc143767 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2611519 Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: AND signals SLP_S3_L and PG_PWR_S5Rob Barnes2021-01-191-0/+11
| | | | | | | | | | | | | | | Discrete AND gate was replaced with EC logic. AND signals SLP_S3_L and PG_PWR_S5 to drive EN_PWR_S0. BUG=b:177071412 TEST=Build BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I473a82dfe8e04f06cc8d2fc0639c9aaed401069a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2618387 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* guybrush: AND PG_LPDDR4X_S3 and PG_GROUPC_S0 signalsRob Barnes2021-01-151-0/+10
| | | | | | | | | | | | | | | Latest schematic removes discrete AND gate and moves logic to EC. PG_LPDDR4X_S3 and PG_GROUPC_S0 are anded to drive EN_PWR_PCORE_S0. BUG=b:177071076 BRANCH=None TEST=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Ic4e50015b495faad4a23e09faa5cd520eb158fe4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2618386 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* guybrush: implement board_overcurrent_eventRob Barnes2021-01-141-0/+13
| | | | | | | | | | | | | | Alert SOC for USB overcurrent event. BUG=None BRANCH=None TEST=Build Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I6be30a3e717e3fb469ae1b6c4f6a75a55c52182f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2618384 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>