Commit Graph

26 Commits

Author SHA1 Message Date
a0c81f6304 Improvements for determining CPU state using virtual wires 2023-04-03 13:06:16 -06:00
4e11f6220b Fix comparisons of vw_get values 2023-04-03 13:06:16 -06:00
cea89a78d8 Use ESPI VW signals wherever possible 2023-04-03 13:06:16 -06:00
cda67e6d1e Fix stalls in getting PECI information over eSPI 2023-04-03 13:06:16 -06:00
9abd9d853a common: peci: WIP peci_get_temp over espi 2023-04-03 13:06:16 -06:00
95a654aaff common: peci: Remove extra shift in peci_get_temp 2023-04-03 13:06:16 -06:00
53f22a6658 common: Break out PECI GetTemp logic, prepare for PECI over ESPI 2023-04-03 13:06:16 -06:00
e032c5f0f2 Update .clang-format and apply
Update .clang-format for LLVM 14.0, available on Ubuntu 22.04.

There is still plenty that clang-format sucks at or does wrong, so
either add some more blocks to disable it, or just put up with it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-10 12:02:21 -07:00
cc3effb6a4 board/system76/common: use SLP_S0# pin for modern standby detection
Previously, CPU_C10_GATE# was used for detecting entry into s0ix /
Modern Standby.

Intel documentation says that SLP_S0# should be used for s0ix detection
instead, and CPU_C10_GATE# is intended for VCCSTG power gating, so
switch the pin to improve s0ix detection reliability.

Fixes https://github.com/system76/firmware-open/issues/199

References:

- Intel docs #575570 rev 0.5, #607872 rev 2.2
- Chromium EC: https://chromium.googlesource.com/chromiumos/platform/ec/+/master/power/intel_x86.c#41

Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
2022-08-30 08:47:30 -06:00
49abf83c08 Add config for using S0ix
S0ix does not require eSPI, and eSPI does not mandate S0ix.

Enable S0ix for:

- darp7 (TGL-U)
- darp8 (ADL-P)
- galp5 (TGL-U)
- galp6 (ADL-P)
- lemp10 (TGL-U)
- lemp11 (ADL-U)

It is also currently enabled on ADL-H due to a bug with S3:

- gaze17-3050
- gaze17-3060-b
- oryp9

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-08-30 08:47:30 -06:00
99af8a35f5 Use explicitly sized types from stdint
Replace bare int types with stdint types. This was done with:

    grep -rwl 'int' src/ | xargs sed -i 's/\<int\>/int16_t/g'
    grep -rwl 'unsigned long' src/ | xargs sed -i 's/\<unsigned long\>/uint32_t/g'
    grep -rwl 'unsigned char' src/ | xargs sed -i 's/\<unsigned char\>/uint8_t/g'

Then reverted for *main(), putchar(), and getchar().

The Arduino declarations for parallel_main() were also corrected to
match their definitions.

SDCC does *not* generate the same code in all instances, due to `int`
being treated different than `short int`.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-08-02 07:46:44 -06:00
90057df94f Change repetitive prints from DEBUG to TRACE 2021-07-20 10:49:08 -06:00
8ea0403850 Smooth fan speed changes (#190)
* SMOOTH_FANS, SMOOTH_FANS_UP, SMOOTH_FANS_DOWN build flags to smooth fan speed changes.
Defaults 40, set SMOOTH_FANS=0 to disable and keep sharp fan speed changes

* fix for ACPI CPU temperature

* allow for a floor to be set for fan smoothing and specifically configure oryp6/7 to start smoothing at 25% to mitigate fan buzzing below 25%

* update default config values for fans

* update all devices to use defaults for heatup, cooldown, update galp5 fan curves

* Decrease default cooldown time from 20 to 10

Co-authored-by: Jacob Kauffmann <jacob@system76.com>
2021-06-14 14:22:29 -06:00
720af4b2b0 Use BIT macro
Mostly done with the cocci script. macro.h was then added manually.
2021-05-07 11:24:25 -06:00
f0c42f5839 Sync dGPU and PECI fans (at highest requested duty) 2021-05-01 06:33:40 -06:00
a04d353096 Fix fan_max keeping fan on when in S0iX 2021-04-02 13:38:28 -06:00
c3fa2a27a7 system76/common/peci.c: Do not use PECI when in C10 state and using ESPI 2021-01-05 12:17:16 -07:00
d35e375277 Add fan abstraction 2020-10-05 10:50:11 -07:00
a8f5fc5ec0 Add fan module and implement fan_max switch 2020-10-05 10:50:11 -07:00
5fd9df0ed0 Add SPDX license identifiers
Add license information to files. Mostly automated with:

    find src/ -name '*.[c,h]' | xargs sed -i '1s,^,// SPDX-License-Identifier: GPL-3.0-only\n\n,'
    find src/ -name '*.mk' | xargs sed -i '1s,^,# SPDX-License-Identifier: GPL-3.0-only\n\n,'
2020-09-17 09:17:08 -06:00
42e88d03b3 Move most code in system76 boards into system76/common 2020-06-24 17:43:39 -06:00
35dd23091e system76/common/peci.c: allow board overrides 2020-06-24 09:14:50 -06:00
90bdcb3818 Set power limits on AC plug event 2020-06-17 11:51:08 -06:00
3a31121625 Add another fan point of 65% at 85C 2020-04-18 15:58:36 -06:00
53d4c31798 lemp9: lower maximum fan speed 2020-04-17 15:28:35 -06:00
357fae86fc System76 common board directory (#53)
* Move configuration for battery into board.mk

* lemp9: remove tcpm code

* Move touchpad to its own module

* Add kbled_reset to all platforms, move items to run on CPU reset to a function

* Add defines for battery and charger address

* Add I2C_0 export to it5570e

* Move common system76 board functions into src/board/system76/common
2020-04-14 17:23:29 -06:00