summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJameson Thies <jthies@google.com>2024-09-17 21:03:05 +0000
committerFelix Held <felix-coreboot@felixheld.de>2024-09-30 16:54:44 +0000
commit920c0a604560e179b7b1435260e25ec918f0cd74 (patch)
treedac6a8fcce8bdc3fb7296ad74f124e6db8f15b39 /src
parent460e2173ebd0fac8c5aa58bcdee6ff092909ada4 (diff)
chromeec/ec_acpi: Define ACPI devices for USB-C ports using UCSI
Add support to define ACPI devices for USB-C ports using UCSI. When defining the typec configuration do not set mux/retimer information. cros_ec_ucsi does not support setting USB muxes. BUG=b:349822718 TEST=emerge-brox coreboot chromeos-bootimage. Boot to OS on brox, confirmed that there are ACPI devices for each USB-C port and cros_ec_ucsi correctly matched the ACPI devices ("ls -l /sys/class/typec" with an update to add an ACPI match table to the cros_ec_ucsi driver). Change-Id: Ie7c281fe2a7fab705d3c238dcc4be68c93afd652 Signed-off-by: Jameson Thies <jthies@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84404 Reviewed-by: Subrata Banik <subratabanik@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/ec/google/chromeec/ec_acpi.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c
index 1c97dcc92d..65a425b793 100644
--- a/src/ec/google/chromeec/ec_acpi.c
+++ b/src/ec/google/chromeec/ec_acpi.c
@@ -18,6 +18,12 @@
#define GOOGLE_CHROMEEC_USBC_DEVICE_HID "GOOG0014"
#define GOOGLE_CHROMEEC_USBC_DEVICE_NAME "USBC"
+/*
+ * Boards using UCSI need the USB-C ports to match with cros_ec_ucsi, not
+ * cros-ec-typec.
+ */
+#define GOOGLE_CHROMEEC_USBC_UCSI_DEVICE_HID "GOOG0021"
+
const char *google_chromeec_acpi_name(const struct device *dev)
{
/*
@@ -157,11 +163,6 @@ static void fill_ssdt_typec_device(const struct device *dev)
struct acpi_pld pld = {0};
uint32_t pcap_mask = 0;
- /* UCSI implementations do not require an ACPI device with mux info since the
- linux kernel doesn't set the muxes. */
- if (google_chromeec_get_ucsi_enabled())
- return;
-
rv = google_chromeec_get_num_pd_ports(&num_ports);
if (rv || num_ports == 0)
return;
@@ -173,9 +174,19 @@ static void fill_ssdt_typec_device(const struct device *dev)
acpigen_write_scope(acpi_device_path(dev));
acpigen_write_device(GOOGLE_CHROMEEC_USBC_DEVICE_NAME);
- acpigen_write_name_string("_HID", GOOGLE_CHROMEEC_USBC_DEVICE_HID);
- acpigen_write_name_string("_DDN", "ChromeOS EC Embedded Controller "
- "USB Type-C Control");
+
+ bool ucsi_platform = google_chromeec_get_ucsi_enabled();
+ if (ucsi_platform) {
+ acpigen_write_name_string("_HID",
+ GOOGLE_CHROMEEC_USBC_UCSI_DEVICE_HID);
+ acpigen_write_name_string("_DDN", "ChromeOS EC UCSI USB Type-C "
+ "Control");
+ } else {
+ acpigen_write_name_string("_HID",
+ GOOGLE_CHROMEEC_USBC_DEVICE_HID);
+ acpigen_write_name_string("_DDN", "ChromeOS EC Embedded "
+ "Controller USB Type-C Control");
+ }
for (i = 0; i < num_ports; ++i) {
rv = google_chromeec_get_pd_port_caps(i, &port_caps);