Commit Graph

923 Commits

Author SHA1 Message Date
Tim Crawford 6255c13927 {ec,mb}/system76: Replace color keyboard logic
System76 EC since system76/ec@9ac513128a detects if the keyboard is
white or RGB backlit via `RGBKB-DET#` at runtime. Remove the Kconfig for
the selection and update the ACPI methods for the new functionality.

Change-Id: I60d3d165a58e30d2afc8736c0eb64dd90c8227ca
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76152
Reviewed-by: Jeremy Soller <jeremy@system76.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-07-18 15:03:16 +00:00
Kapil Porwal 2ba4b1bebe ec/google/chromeec: Split wait-loop for DP and HPD flags
Split wait-loop for DP and HPD flags as below -
- google_chromeec_wait_for_hpd
- google_chromeec_wait_for_dp_mode_entry

BUG=b:247670186
TEST=Verify display over TCSS and its impact on boot time for
google/rex

Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Change-Id: I3e565d6134f6433930916071e94d56d92dc6cb06
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76370
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-07-15 12:47:51 +00:00
Kapil Porwal 1d85464df8 ec/google/chromeec: Call `wait_for_dp_hpd` only in AP mode entry
Wait for DP/HPD flags only in AP initiated mode entry

BUG=b:247670186
TEST=Verify display over TCSS and its impact on boot time for
google/rex

Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Change-Id: I5137c346fbf1edabc60a53e0978e32f54885c330
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76369
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-07-15 12:47:44 +00:00
Kapil Porwal 9a127bf2d1 ec/google/chromeec: Skip TCSS `wait_for_connection` for AP mode entry
Skip TCSS `wait_for_connection` for AP initiated mode entry.

BUG=b:247670186
TEST=Verify display over TCSS and its impact on boot time for
google/rex

Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Change-Id: Ia04ff470961831237fe851f7ae3feaa5623d4b4a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76368
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-07-15 12:47:12 +00:00
Kapil Porwal c2c5801dcd ec/google/chromeec: Skip unnecessary call to TCSS `enter_dp_mode` cmd
Skip TCSS `enter_dp_mode` command when there is no USB device detected
on the port.

BUG=b:247670186
TEST=Verify display over TCSS and its impact on boot time for
google/rex

Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Change-Id: Ie6cd84cab3631596d4d7178dae2040e25c621f63
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76352
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-07-15 12:47:02 +00:00
Tim Crawford 8e8a2b496e ec/system76/ec: Do not call reset on wake
Resetting the device will cause the keyboard backlight and airplane LED
to lose their state.

Change-Id: I2f46542fb6b32c479b01335149c9190f6fa1421f
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75275
Reviewed-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-by: Jeremy Soller <jeremy@system76.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-07-03 12:56:14 +00:00
lilacious 40cb3fe94d commonlib/console/post_code.h: Change post code prefix to POSTCODE
The prefix POSTCODE makes it clear that the macro is a post code.
Hence, replace related macros starting with POST to POSTCODE and
also replace every instance the macros are invoked with the new
name.

The files was changed by running the following bash script from the
top level directory.

  sed -i'' '30,${s/#define POST/#define POSTCODE/g;}' \
  src/commonlib/include/commonlib/console/post_codes.h;
  myArray=`grep -e "^#define POSTCODE_" \
  src/commonlib/include/commonlib/console/post_codes.h | \
  grep -v "POST_CODES_H" | tr '\t' ' ' | cut -d ' ' -f 2`;

  for str in ${myArray[@]}; do
    splitstr=`echo $str | cut -d '_' -f2-`
    grep -r POST_$splitstr src | \
    cut -d ':' -f 1 | xargs sed -i'' -e "s/POST_$splitstr/$str/g";
    grep -r "POST_$splitstr" util/cbfstool | \
    cut -d ':' -f 1 | xargs sed -i'' -e "s/POST_$splitstr/$str/g";
  done

Change-Id: I25db79fa15f032c08678f66d86c10c928b7de9b8
Signed-off-by: lilacious <yuchenhe126@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76043
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-06-23 15:06:04 +00:00
Jonathon Hall a41c825068 ec/purism,system76: Provide probe for fixed Librem-EC jack detect
Provide system76_ec_cmd() to send arbitrary commands to the EC.

Provide librem_ec_has_jack_detect() to probe for the jack detect fix.

Change-Id: Ic7bda0ce230a3ad68dfeb7b01a0e04f70dab9e5d
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74390
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Crawford <tcrawford@system76.com>
2023-05-26 14:57:27 +00:00
Matt DeVillier 90f9d1c409 ec/google/chromeec/ACPI: Set TBMC status based on motion sensor presence
Use ECRAM field MTNS to determine if motion sensor present, and set
TBMC device status accordingly.

TEST=build/boot google/{jinlon,drobit}, verify ACPI status for TMBC
correct for both devices with and without tablet mode.

Change-Id: Ic06ab6d721f0a3435e6dfd7b5e130f378096afec
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75172
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: CoolStar <coolstarorganization@gmail.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-05-17 11:22:09 +00:00
Caveh Jalali beaa8f895d ec/google/chromeec: Use host command API
Update the chromeec driver to use the EC host command API. Large blocks
of repetitive code to set up EC calls are replaced with single function
calls to perform the same operation.

BUG=b:258126464
BRANCH=none
TEST=booted on rex

Change-Id: I0317405b1ed0c58568078133c17c8cfbc7c21d80
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73325
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-05-16 16:34:43 +00:00
Caveh Jalali 839ada15ff ec/google/chromeec: Add ec_cmd_api.h, update ec_commands.h
The new util/chromeos/update_ec_headers.sh utility is used to update
ec_commands.h and introduce ec_cmd_api.h from the chrome EC repo.

ec_cmd_api.h is a new file from the chrome EC repo which defines the API
for communicating with the EC. It is a companion to the existing
ec_commands.h by defining functions corresponding to EC host command
opcodes and request/response struct definitions.
See $EC/docs/ec-host-command-api.md for details.

Generated using update_ec_headers.sh [EC-DIR].

The original include/ec_commands.h version in the EC repo is:
  3e35858003 ec: Add another #line directive
The original include/ec_cmd_api.h version in the EC repo is:
  59de61f2db zephyr: Add support for RNG devices

BUG=b:258126464
BRANCH=none
TEST=none

Change-Id: I30f20e34d31b7e19cf03f65fefd58ae64eef1d41
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73324
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-05-16 16:34:30 +00:00
Matt DeVillier 625066e4f4 ec/quanta/ene_kb3940q/acpi: Fix PS2K under Windows
Add _HID to parent SIO device so Windows can find the PS2K, and
remove _ADR since HID and ADR are mutually exclusive.

TEST=build/boot Win11 on google/butterfly, verify keyboard functional.

Change-Id: I772ceef1b439cfd4e2740e53362bee9d494fb36d
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75174
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2023-05-13 18:35:44 +00:00
Kyösti Mälkki 497fea7d67 ec/google/chromeec: Handle ACPI S4 in chromeec_smi_sleep()
While Chromebook hardware originally would not have the
capacity to do suspend-to-disk (ACPI S4), the power management
code in EC should react to S4 request as if it was S5 request.

Change-Id: Ida9118919c8149d94f470847d0c4aad9c0b97d3e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74823
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2023-05-07 14:54:12 +00:00
Sean Rhodes 543bba8f8f ec/starlabs/merlin: Change the fallback value for fn_ctrl_swap
Change the fallback value of the `fn_ctrl_swap` option to 0, which
is disabled.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I76329ec59ba630c987a122bffb8045150facdf08
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74916
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2023-05-03 21:50:36 +00:00
Sean Rhodes c45cfadf36 ec/starlabs/merlin: Change the fallback value for fn_ctrl_swap
Change the fallback value of the `fn_ctrl_swap` option to 0, which
is disabled.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I9fcbb497f14ed0c97ff05c6c01a3929522786781
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74744
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2023-04-28 15:30:25 +00:00
Sean Rhodes 7e300f51ac ec/starlabs/merlin/acpi: Don't attempt to change EC values
The EC will constantly update the battery variables approximately
every 60 seconds; they should be used unmodified, rather than
trying to change them.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I3cff0ac6a322018cbca33b5f90dd62b3475da25c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74186
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2023-04-28 15:29:51 +00:00
Felix Held 0854f67cae ec/acpi/ec: replace misleading "recv_ec_data_timeout" console output
In the non-timeout case in recv_ec_data_timeout, a message like this one
will get printed at BIOS_SPEW log level: "recv_ec_data_timeout: 0x00".
The "timeout" part of the function name corresponds to what the function
does, but the message will only be printed when not running into the
timeout which is a bit misleading and might suggest a problem when there
is none. To avoid this possible confusion, don't use the function name
in the printk, but use "Data from EC:" instead.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I521f67517f64fc64e24853d96730c3f9459f1ccc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74381
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
2023-04-14 23:47:29 +00:00
Sumeet Pawnikar 2f7fa55433 Reland "drivers/intel/dptf: Add multiple fan support under dptf"
This reverts commit 4dba71fd25.

Add multiple fan support for dptf policies.

This also fixes the Google Meet resolution drop issue as per
b:246535768 comment#12. When system starts Google Meet video call,
it uses the hardware accelerated encoder as expected. But, as soon as
another system connects to the call, an immediate fallback is observed
from hardware to software encoder. Due to this, Google Meet resolution
dropped from 720p to 180p. This issue is observed on Alder Lake-N SoC
based fanless platforms. This same issue was not seen on fan based
systems. With the fix in dptf driver where fan configures appropriate
setting for only fan participant, not for other device participants,
able to see consistent 720p resolution.

BUG=b:246535768,b:235254828
BRANCH=None
TEST=Built and tested on Alder Lake-P Redrix system for two fans
support and on Alder Lake-N fanless systems. With this code change
Google Meet resolution drop not observed.

Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Change-Id: Id07d279ff962253c22be9d395ed7be0d732aeaa7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73249
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Reka Norman <rekanorman@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-04-12 14:11:45 +00:00
Karthikeyan Ramasubramanian 8fc20c4961 ec/google/chromeec: Use either EC or MB lid switch state
With CB:16732, EC can provide default lid switch implementation(LID0
ACPI device). Up until that point, mainboard has been providing default
switch implementation. When EC provides lid switch implementation, the
lid switch state is read from EC either through MMAP or LPC interface.
Hence there is no need to keep mainboard's LIDS ACPI object in sync with
EC's lid switch state. Use only EC's lid switch state on boards using
EC's implementation. This paves the way to remove LIDS ACPI object on
those mainboards.

BUG=None
TEST=Build Skyrim BIOS image and boot to OS. Trigger lid open/close
events and ensure that they are detected properly through
/proc/acpi/button/lid/LID0/state.
localhost ~ # cat /proc/acpi/button/lid/LID0/state
state:      open
localhost ~ # cat /proc/acpi/button/lid/LID0/state
state:      closed

Ensure that the system behaves as expected based on powerd
configuration. After signin, system suspends/resumes for lid close/open.
On signin screen, system shuts down/boots for lid close/open.

Change-Id: I013574d7c21761f167ad38aeed27a419677b8000
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74332
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rob Barnes <robbarnes@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
2023-04-12 12:57:55 +00:00
Elyes Haouas af93336da3 ec/lenovo/pmh7/chip.h: Use 'bool' instead of 'int'
This to fix following error using Clang-16.0.0:
/cb-build/coreboot-toolchain.0/clang/LENOVO_W500/mainboard/lenovo/t400/static.c:135:22: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
        .backlight_enable = 0x01,
                            ^~~~
/cb-build/coreboot-toolchain.0/clang/LENOVO_W500/mainboard/lenovo/t400/static.c:136:23: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
        .dock_event_enable = 0x01,
                             ^~~~

Change-Id: Icd35224877fee355e1bbb8a8e838cb047604babb
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73810
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2023-04-08 03:36:07 +00:00
Sean Rhodes 0579c609fb ec/starlabs/merlin: Add support for the ITE mirror flag
When enabled, the EC will mirror the firmware contained inside the
coreboot ROM. This allows it to be updated at the same time as
coreboot.

Enable the mirror flag if the installed EC firmware does not match
the target version or if a CMOS option, "manual_mirror_flag" is
set.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I377abbb37dc4d3e535e518a73e73969b25967daa
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73044
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2023-04-04 14:10:44 +00:00
Sean Rhodes 2285b72d06 Revert "ec/starlabs/merlin: Add support for enabling the mirror flag"
This reverts commit b42ca4d0b2.

Reason for revert: The mirror flag "0x01" is mirror once, which
relies on the EC remembering that it's been mirrored. However, the
EC forgets this if it's been without power for 20 minutes or so.

Even if power is connected then, it'll instantly try to mirror and
it can't charge whilst doing it. It can either result in
incomplete EC firmware, or a loop where it's constantly trying to
mirror.

Change-Id: I79da9143cc63459e7e29431eff2cb14200424b37
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72678
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2023-03-09 21:38:26 +00:00
Tim Crawford e0c96dacce {ec,mb}/system76: Move smbios_system_wakeup_type
Move the implementation of smbios_system_wakeup_type from the mainboards
to the EC for all models that use System76 EC (everything except KBL).

Change-Id: Iaace234ca87e8a05eaa006a438d2c9eb13ce4d76
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71802
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jeremy Soller <jeremy@system76.com>
2023-03-04 01:58:35 +00:00
Tim Van Patten 64871adae0 acpi/ec: Handle new host event EC_HOST_EVENT_BODY_DETECT_CHANGE
Handle the new host event EC_HOST_EVENT_BODY_DETECT_CHANGE.

Previously, the EC sent the host event EC_HOST_EVENT_MODE_CHANGE when
body detection changed between lap/desk mode. However, that event is a
wake event, which resulted in spurious AP wake events being triggered
when the EC detected lap/desk mode changes while the AP was suspended.

To resolve this, the new host event EC_HOST_EVENT_BODY_DETECT_CHANGE was
added, which will not be a wake event. This CL adds handling for the new
event to acpi/ec.asl to switch DPTC tables when a change is detected.

BRANCH=none
BUG=b:261141172
TEST=bodydetectmode on|off, verify host event is received

Change-Id: Iabeb7891489a209f45504804355f1fa817082976
Signed-off-by: Tim Van Patten <timvp@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73298
Reviewed-by: Caveh Jalali <caveh@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2023-03-02 16:16:56 +00:00
Tim Van Patten cab6060ed1 ec/google/chromeec: Update ec_commands.h
Update ec_commands.h from the EC repo at:
  "8441cf4 Add host event: EC_HOST_EVENT_BODY_DETECT_CHANGE"

This is an exact copy of the EC repo's ec_commands.h with the
exception of updating the copyright message.

BUG=b:261141172
BRANCH=none
TEST=built coreboot for skyrim

Change-Id: I9892c0c3518f63d357459861e8fa1b7f5f494e68
Signed-off-by: Tim Van Patten <timvp@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73258
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Caveh Jalali <caveh@chromium.org>
2023-02-27 16:41:30 +00:00
Elyes Haouas 1548032c98 treewide: Remove useless "_STA: Status" comment
Change-Id: I99ded00fa6dadb494c1523d00063dbc1fde95614
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73093
Reviewed-by: Tim Crawford <tcrawford@system76.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-02-19 11:20:37 +00:00
Elyes Haouas 59f8a50686 treewide: Remove unuseful "_UID: Unique ID" comment
Change-Id: I150a4ed94bcaead6eb45f1c4b4952ae6957e0940
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72663
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2023-02-17 15:40:36 +00:00
Elyes Haouas eb83fed09f treewide: Remove unuseful "_HID: Hardware ID" comment
Change-Id: I5eb1424e9e6c1fbf20cd0bf68fbb52e1ec97f905
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72661
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Crawford <tcrawford@system76.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2023-02-17 15:37:52 +00:00
Nicholas Chin e0e6bccd44 ec/dell: Add support for the SMSC MEC5035
This is required to prevent the EC from shutting down the system after
about 15 seconds after being turned on. If the EC doesn't receive a
command meaning "CPU OK" it assumes that the processor has failed and
flashes a diagnostic code on the keyboard LEDs to indicate this.

This also enables the keyboard and trackpad/trackpoint interfaces.

Parts of this code were derived from yet-to-be merged code in CB:44975
(ec: Add support for MEC5055 for Dell laptops) written by Iru Cai.

Tested on a Dell Latitude E6400

Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Change-Id: Ia420cd51e9a64be5eee4af2c0d113618575522b0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59703
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-02-08 19:21:59 +00:00
Caveh Jalali 6bd733b7d4 ec/google/chromeec: Update ec_commands.h
Update ec_commands.h from the EC repo at:
  "8b6f7de2a7 fan: update fan stalled value reporting"

This is an exact copy of the EC repo's ec_commands.h with the
exception of updating the copyright message.

BUG=b:258110734
BRANCH=none
TEST=built coreboot for brya

Change-Id: I4ce15e1af40cc54a6cf2ebd6f5d5adf8953dee60
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72640
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2023-02-08 19:17:51 +00:00
Caveh Jalali 024ffe3fdd ec/google/chromeec: clang-format ec_commands.h
This is a format-only change: Reformat ec_commands.h using clang-format
according to the EC repo's current formatting style.

The command is:

  clang-format --style=file:$EC/.clang-format -i ec_commands.h
  where $EC points to the chromeos EC repo.

The EC repo has recently adpoted the practice of formatting all files
through clang-format using its own style. So, run ec_commands.h through
the EC's clang-format so future updates don't get overwhelmed by
inconsequential style changes.

BUG=b:258110734
BRANCH=none
TEST=built coreboot for brya

Change-Id: Icbd6d00922dc5fd4c44ee109d54cea612e15db06
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72639
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2023-02-08 19:17:24 +00:00
Matt DeVillier 985acc218b ec/google/wilco/acpi: Add DPTF RCDP() method
The Windows DPTF drivers expect this method, and if not present appear
to hang. Adding this method fixes DPTF under Windows on drallion.

Modeled after existing method used by chrome-ec.

TEST=build/boot Win11 on google/drallion, verify DPTF functional.

Change-Id: I6570345379da413273251ecf5209c4997aac9b11
Original-patch-by: Coolstar <coolstarorganization@gmail.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72578
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Caveh Jalali <caveh@chromium.org>
2023-02-01 14:59:44 +00:00
Matt DeVillier 05be8c626c ec/google/chrome-ec: Demote Vivaldi printk from error to info
Not all Chrome-EC devices have a keyboard or use Vivaldi for key
remapping, so demote the printk output when the EC doesn't support
it from ERROR to INFO. Adjust the printk text for clarity.

Change-Id: I14059f4e3e56ff891f302601d5acc1bb842cffc1
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72474
Reviewed-by: Caveh Jalali <caveh@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-01-28 03:43:14 +00:00
Felix Held 831d686e6b ec/google/chromeec/acpi/ec: add scope comment to nested #endif
To make the code slightly easier to read, add a comment about the scope
to the #endif of the outer #ifdef block.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ic2bc83c77750cd8a509f4755fdfa4daaf082d754
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72137
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Caveh Jalali <caveh@chromium.org>
2023-01-22 00:38:03 +00:00
Prashant Malani 8c3fa461f3 ec/google/chromeec: Add retimer flag for mux device
Not all ports have retimers. Add a property to denote that a particular
port has a retimer (instead of assuming that all ports have retimers).

BUG=b:263964979
TEST=Verified on guybrush; SSDT shows retimer-switch on port1 when
device tree is updated accordingly.

Change-Id: I754323236d2912777b63cede0fce2ccf7882cfea
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71663
Reviewed-by: Robert Zieba <robertzieba@google.com>
Reviewed-by: Caveh Jalali <caveh@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-01-11 16:37:38 +00:00
Derek Huang da3812208e chromeos/cr50_enable_update.c: Clear EC AP_IDLE flag
When AP boots up after Cr50 firmware update and reboot, AP finds
that Cr50 reset is required for Cr50 to pick the new firmware so
it trigger Cr50 reset and power off the system, AP expects system
will power on automatically after Cr50 reset. However this is not
the case for Chromebox, Chromebox EC set AP_IDLE flag when system
is shutting down, when AP_IDLE flag is set in EC, the system stays
at S5/G3 and wait for power button presssend. It cause an issue in
factory that the operator needs to press power button to power on
the DUT after Cr50 firmware update.

This patch sends EC command to direct EC to clear AP_IDLE flag
after AP shutdown so AP can boot up when Cr50 reset.

BUG=b:261119366
BRANCH=firmware-brya-14505.B
TEST=DUT boots up after Cr50 firmware update in factory test flow

Change-Id: If97ffbe65f4783f17f4747a87b0bf89a2b021a3b
Signed-off-by: Derek Huang <derekhuang@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70773
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-01-10 09:33:47 +00:00
Felix Singer fcdb03d079 {ec,mb}/system76/acpi: Use Printf() for debug prints
Change-Id: Ia5ae30a1ee976b8059936027b28ac56f37279217
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71516
Reviewed-by: Tim Crawford <tcrawford@system76.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-29 16:30:15 +00:00
Felix Singer 42efd7f593 {superio,ec}/acpi: Replace constant "Zero" with actual number
Change-Id: I449ec5b0bbf3f24d51688efef151d3018d2848b2
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71524
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-27 09:06:29 +00:00
Felix Singer ca4b587f95 {superio,ec}/acpi: Replace constant "One" with actual number
Change-Id: I5c77b6d1e1dc1134f62dcb3e93df01dc9c2f386c
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71520
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-27 09:03:34 +00:00
Felix Singer 8171364d06 tree/acpi: Replace Divide(a,b,c,d) with ASL 2.0 syntax
Replace `Divide (a, b, c, d)` with these instructions:

  c = a % b
  d = a / b

Change-Id: I44366be5b5145a5d19f85df7a2f338866cb9c8b0
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71515
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2022-12-26 19:57:44 +00:00
Felix Singer c87c1abffb tree/acpi: Replace Not(a) with ASL 2.0 syntax
Replace `Not (a)` with `~a`.

Change-Id: I53993fb7b46b3614d18ee001323f17efacbf04c1
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71513
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-26 19:56:04 +00:00
Felix Singer d252776668 tree: Replace And(a,b) with ASL 2.0 syntax
Replace `And (a, b)` with `a & b`.

Change-Id: Id8bbd1a477e6286bbcb5fa31afd1c7a860b1c7dc
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70851
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-23 10:18:55 +00:00
Felix Singer 35e65a8bc3 tree: Replace And(a,b,c) with ASL 2.0 syntax
Replace `And (a, b, c)` with `c = a & b`, respectively `c &= b` where
possible.

Change-Id: Ie558f9d0b597c56ca3b31498edb68de8877d3a2f
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70850
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-23 10:18:48 +00:00
Felix Singer 86bc2e708d tree: Replace Or(a,b,c) with ASL 2.0 syntax
Replace `Or (a, b, c)` with `c = a | b`, respectively `c |= b` where
possible.

Change-Id: Icf194b248075f290de90fb4bc4e9a0cd9d76ec61
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70846
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-23 10:17:34 +00:00
Felix Singer 372573eaff tree: Replace ShiftLeft(a,b) with ASL 2.0 syntax
Replace `ShiftLeft (a, b)` with `a << b`.

Change-Id: I812b1ed9dcf3a5749b39a9beb9f870258ad6a0de
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70842
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-23 08:30:39 +00:00
Felix Singer 3c9291b335 tree: Replace ShiftLeft(a,b,c) with ASL 2.0 syntax
Replace `ShiftLeft (a, b, c)` with `c = a << b`.

Change-Id: Ibd25a05f49f79e80592482a1b0532334f727af58
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70841
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-23 08:30:09 +00:00
Felix Singer 034920c1d4 tree: Replace ShiftRight(a,b,c) with ASL 2.0 syntax
Replace `ShiftRight (a, b, c)` with `c = a >> b`. One case was
simplified to just `a >> b`.

Change-Id: I889012b0a3067138e6f02d3fe8e97151effb5c2a
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70840
Reviewed-by: Caveh Jalali <caveh@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
2022-12-23 03:16:35 +00:00
Felix Singer 274fa64e3d tree: Replace Or(a,b) with ASL 2.0 syntax
Replace `Or (a, b)` with `a | b`.

Change-Id: I73842cd4843ebb0b48440059ae9dcf6c82235a76
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70845
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2022-12-19 16:20:23 +00:00
Felix Singer f3649f03f3 tree: Replace XOr(a,b,c) with ASL 2.0 syntax
Replace `XOr (a, b, c)` with `c = a ^ b`, respectively `c ^= b` where
possible.

Change-Id: Ic5f67684bbd4ea115c4dae8a4417d88bea0d6b77
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70843
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2022-12-19 16:13:50 +00:00
Sean Rhodes 836881935f ec/starlabs/merlin: Add EC related files for Cezanne laptops
Add EC memory layout and Q events for AMD Cezanne based boards,
the "StarBook Mk VI" and "StarFighter Mk I", which both use the ITE
5570E.

Change-Id: I87806b830b3d58a6ce3b89f45b5a07f4502a87f3
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68333
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-19 14:12:11 +00:00