Add UCSI I2C transport driver for ITE885x USB-C controllers
Subsystems (6)
cover Add UCSI I2C transport driver for ITE885x USB-C controllers
ASUS Z690/Z790/X670E motherboards use ITE8853 (and related ITE8800-ITE8805) USB Type-C controllers that implement UCSI over I2C. These are currently unsupported in Linux, causing a boot error:
i2c i2c-1: Failed to register i2c client ITE8853:00 at 0x40 (-16)
The BIOS on these boards declares two ACPI devices for the same physical hardware at the same I2C address: a generic UCSI device (MSFT8000) and a vendor-specific device (ITE8853). The generic device registers first during ACPI enumeration, blocking the vendor-specific one with -EBUSY. The ITE8853 ACPI device carries the GPIO interrupt resource needed for proper operation, while MSFT8000 does not.
Patch 1 fixes the i2c ACPI enumeration to skip known generic devices when a vendor-specific sibling exists at the same address. This is a general fix that could benefit other platforms with the same BIOS pattern.
Patch 2 adds the ITE885x UCSI transport driver, modeled after ucsi_stm32g0.c. The only device-specific quirk is that PPM_RESET is handled internally by the ITE8853 and must not be sent over I2C.
Tested on ASUS ROG Strix Z790-E Gaming WiFi:
- Boot error eliminated
- /sys/class/typec/port0 registered successfully
- UCSI commands complete within one polling cycle (~50ms)
- USB-C device attach/detach detected with partner enumeration
- USB Power Delivery negotiation functional
- SuperSpeed Plus Gen 2x1 devices operational through UCSI-managed port
No MAINTAINERS entry is added as the driver falls under the existing USB TYPEC UCSI section. Happy to add one if preferred.
Edward Blair (2):
i2c: acpi: skip generic I2C device when vendor-specific sibling exists
usb: typec: ucsi: add ITE885x I2C transport driver
drivers/i2c/i2c-core-acpi.c | 88 +++++++++ drivers/usb/typec/ucsi/Kconfig | 11 ++ drivers/usb/typec/ucsi/Makefile | 1 + drivers/usb/typec/ucsi/ucsi_ite.c | 285 ++++++++++++++++++++++++++++++ 4 files changed, 385 insertions(+) create mode 100644 drivers/usb/typec/ucsi/ucsi_ite.c
Signature · 1 line
2.53.0
PATCH 1/2 i2c: acpi: skip generic I2C device when vendor-specific sibling exists
Some BIOS implementations (notably ASUS Z690/Z790/X670E motherboards) declare both a generic UCSI device (MSFT8000) and a vendor-specific device (e.g., ITE8853) as ACPI children of the same I2C controller, both referencing the same I2C slave address.
During ACPI I2C enumeration, whichever device is walked first claims the address, causing the second to fail with -EBUSY. When the generic MSFT8000 device registers first, the vendor-specific driver cannot bind, losing access to device-specific features like GPIO interrupt resources that are only declared on the vendor-specific ACPI device.
Fix this by checking, before registering a known generic I2C device, whether a sibling ACPI device exists at the same address on the same adapter. If so, skip the generic device to let the vendor-specific one register instead.
--- drivers/i2c/i2c-core-acpi.c | 88 +++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+)
drivers/i2c/i2c-core-acpi.c +88 -0
@@ -137,6 +137,17 @@ static const struct acpi_device_id i2c_acpi_ignored_device_ids[] = { {} }; +/* +* Generic I2C device IDs that may be duplicated by vendor-specific devices. +* When a vendor-specific sibling exists at the same address, the generic +* device is skipped to avoid -EBUSY address conflicts. +*/ +static const struct acpi_device_id i2c_acpi_generic_device_ids[] = { +/* Microsoft UCSI - often paired with vendor-specific UCSI device */ + {"MSFT8000" }, + {} +}; +struct i2c_acpi_irq_context {int irq;bool wake_capable;
@@ -274,6 +285,76 @@ static int i2c_acpi_get_info(struct acpi_device *adev,return 0 ; } +struct i2c_acpi_sibling_check { +struct acpi_device *self; +struct i2c_adapter *adapter; +unsigned short addr; +bool found; +}; + +static int i2c_acpi_check_sibling_addr (struct acpi_device *adev,void *data) +{ +struct i2c_acpi_sibling_check *check = data; +struct i2c_acpi_lookup lookup; +struct i2c_board_info info; + +if (adev == check->self) +return 0 ; + +/* Only yield to vendor-specific devices, not other generic ones */ +if (!acpi_match_device_ids (adev, i2c_acpi_generic_device_ids)) +return 0 ; + +memset (&lookup,0 ,sizeof (lookup)); + lookup.info = &info; + lookup.index =-1 ; + +if (i2c_acpi_do_lookup (adev, &lookup)) +return 0 ; + +if (!device_match_acpi_handle (&check->adapter->dev, + lookup.adapter_handle)) +return 0 ; + +if (info.addr == check->addr) { + check->found = true; +return 1 ; + } + +return 0 ; +} + +/* +* Check whether this generic ACPI device has a vendor-specific sibling at the +* same I2C address. Some BIOS implementations (e.g., ASUS Z690/Z790/X670E) +* declare both a generic UCSI device (MSFT8000) and a vendor-specific device +* (e.g., ITE8853) at the same address. Skip the generic one so the vendor +* driver can bind with proper interrupt and device-specific resources. +*/ +static bool i2c_acpi_has_vendor_sibling (struct acpi_device *adev, +struct i2c_adapter *adapter, +struct i2c_board_info *info) +{ +struct acpi_device *parent; +struct i2c_acpi_sibling_check check; + +if (acpi_match_device_ids (adev, i2c_acpi_generic_device_ids)) +return false; + + parent =acpi_dev_parent (adev); +if (!parent) +return false; + + check.self = adev; + check.adapter = adapter; + check.addr = info->addr; + check.found = false; + +acpi_dev_for_each_child (parent, i2c_acpi_check_sibling_addr, &check); + +return check.found; +} +static void i2c_acpi_register_device (struct i2c_adapter *adapter,struct acpi_device *adev,struct i2c_board_info *info)
@@ -302,6 +383,13 @@ static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level,if (!adev ||i2c_acpi_get_info (adev, &info, adapter,NULL ))return AE_OK ; +if (i2c_acpi_has_vendor_sibling (adev, adapter, &info)) { +dev_info (&adapter->dev, +"skipping %s in favor of vendor-specific device at 0x%02x\n" , +dev_name (&adev->dev), info.addr); +return AE_OK ; + } +i2c_acpi_register_device (adapter, adev, &info);return AE_OK ;
Signature · 1 line
2.53.0
Re: [PATCH 1/2] i2c: acpi: skip generic I2C device when vendor-specific sibling exists
Quoted 29 lines · Edward Blair
Some BIOS implementations (notably ASUS Z690/Z790/X670E motherboards) declare both a generic UCSI device (MSFT8000) and a vendor-specific device (e.g., ITE8853) as ACPI children of the same I2C controller, both referencing the same I2C slave address.
During ACPI I2C enumeration, whichever device is walked first claims the address, causing the second to fail with
-EBUSY. When the generic MSFT8000 device registers first, the vendor-specific driver cannot bind, losing access to device-specific features like GPIO interrupt resources that are only declared on the vendor-specific ACPI device.Fix this by checking, before registering a known generic I2C device, whether a sibling ACPI device exists at the same address on the same adapter. If so, skip the generic device to let the vendor-specific one register instead.
Signed-off-by Edward Blair <[email protected]>--- drivers/i2c/i2c-core-acpi.c | 88 +++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+)drivers/i2c/i2c-core-acpi.c +0
-0@@ -137,6 +137,17 @@ static const struct acpi_device_id i2c_acpi_ignored_device_ids[] = { {} };
drivers/i2c/i2c-core-acpi.c static const struct acpi_device_id i2c_acpi_ignored_device_ids[] = { · line 149
Quoted 10 lines
drivers/i2c/i2c-core-acpi.c +10
-0+/* +* Generic I2C device IDs that may be duplicated by vendor-specific devices. +* When a vendor-specific sibling exists at the same address, the generic +* device is skipped to avoid -EBUSY address conflicts. +*/ +static const struct acpi_device_id i2c_acpi_generic_device_ids[] = { +/* Microsoft UCSI - often paired with vendor-specific UCSI device */ + {"MSFT8000" }, + {} +};
Are they both "present"? I mean their _STA() returns 0xF for both?
We have a quirk table already in drivers/acpi/x86/utils.c that I think could be used to mark the other one being not present.
Re: [PATCH 1/2] i2c: acpi: skip generic I2C device when vendor-specific sibling exists
Quoted 1 line · Mika Westerberg
Are they both 'present'? I mean their
_STA()returns0xFfor both?
MSFT8000:00 has no _STA method at all. The sysfs status attribute is absent, which only happens when acpi_has_method(handle, "_STA") returns false (device_sysfs.c line 591). So it defaults to present per the ACPI spec. ITE8853:00 has _STA returning 0xF.
As Heikki pointed out, MSFT8000 is the RhProxy device, not UCSI. My mistake in the commit message.
Quoted 2 lines
We have a quirk table already in
drivers/acpi/x86/utils.cthat I think could be used to mark the other one being not present.
That would work. acpi_device_override_status() runs before _STA evaluation so it can force status=0 even without a _STA method.
My concern is scope. MSFT8000 is a Windows-only Resource Hub Proxy (RhProxy) device with no Linux driver, no module binding, and no in-kernel consumer. It's a static ACPI node with no _STA, so the BIOS exports it unconditionally. Skipping it during I2C client enumeration would have zero functional impact on Linux while avoiding a quirk table entry that needs duplicating per board.
Thanks,
Edward
Re: [PATCH 1/2] i2c: acpi: skip generic I2C device when vendor-specific sibling exists
Quoted 7 lines · Edward Blair
Quoted 1 line · Mika Westerberg
Are they both 'present'? I mean their
_STA()returns0xFfor both?MSFT8000:00 has no
_STAmethod at all. The sysfs status attribute is absent, which only happens whenacpi_has_method(handle, "_STA")returns false (device_sysfs.cline 591). So it defaults to present per the ACPI spec. ITE8853:00 has_STAreturning0xF.
Okay.
Quoted 9 lines
As Heikki pointed out, MSFT8000 is the RhProxy device, not UCSI. My mistake in the commit message.
Quoted 2 lines
We have a quirk table already in
drivers/acpi/x86/utils.cthat I think could be used to mark the other one being not present.That would work.
acpi_device_override_status()runs before_STAevaluation so it can force status=0 even without a_STAmethod.
Quoted 6 lines
My concern is scope. MSFT8000 is a Windows-only Resource Hub Proxy (RhProxy) device with no Linux driver, no module binding, and no in-kernel consumer. It's a static ACPI node with no
_STA, so the BIOS exports it unconditionally. Skipping it during I2C client enumeration would have zero functional impact on Linux while avoiding a quirk table entry that needs duplicating per board.
Well it needs to be somewhere unfortunately :( Gathering these into one file at least makes it sligthly more maintainable IMHO. I think the override_status_ids could be made to use only the HID so no need to add DMI strings. Of course if we ever want to bind a driver to it then it needs to be exposed again (but that sounds unlikely since we already have a real device that a driver could bind to).
Just my 2 cents.
Re: [PATCH 1/2] i2c: acpi: skip generic I2C device when vendor-specific sibling exists
Quoted 2 lines · Mika Westerberg
Well it needs to be somewhere unfortunately :( Gathering these into one file at least makes it sligthly more maintainable IMHO.
Fair enough, I'll move it to override_status_ids[] for v2.
One thing I noticed: the CPU match in acpi_device_override_status() is mandatory, so each CPU family that ships boards with RhProxy will need its own entry. The DMI check is already optional (skipped when slot is unset), but there's no equivalent path for cpu_ids.
For now I'll add an entry for INTEL_RAPTORLAKE_S without DMI, which covers all Raptor Lake desktop boards. Other platforms can add entries as needed. If the per-CPU duplication becomes a problem later, making cpu_ids optional would be a small change to the loop.
Thanks,
Edward
Heikki Krogerus
maintainerRe: [PATCH 1/2] i2c: acpi: skip generic I2C device when vendor-specific sibling exists
In reply to Edward BlairQuoted 29 lines · Edward Blair
Some BIOS implementations (notably ASUS Z690/Z790/X670E motherboards) declare both a generic UCSI device (MSFT8000) and a vendor-specific device (e.g., ITE8853) as ACPI children of the same I2C controller, both referencing the same I2C slave address.
During ACPI I2C enumeration, whichever device is walked first claims the address, causing the second to fail with
-EBUSY. When the generic MSFT8000 device registers first, the vendor-specific driver cannot bind, losing access to device-specific features like GPIO interrupt resources that are only declared on the vendor-specific ACPI device.Fix this by checking, before registering a known generic I2C device, whether a sibling ACPI device exists at the same address on the same adapter. If so, skip the generic device to let the vendor-specific one register instead.
Signed-off-by Edward Blair <[email protected]>--- drivers/i2c/i2c-core-acpi.c | 88 +++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+)drivers/i2c/i2c-core-acpi.c +0
-0@@ -137,6 +137,17 @@ static const struct acpi_device_id i2c_acpi_ignored_device_ids[] = { {} };
drivers/i2c/i2c-core-acpi.c static const struct acpi_device_id i2c_acpi_ignored_device_ids[] = { · line 149
Quoted 10 lines
drivers/i2c/i2c-core-acpi.c +10
-0+/* +* Generic I2C device IDs that may be duplicated by vendor-specific devices. +* When a vendor-specific sibling exists at the same address, the generic +* device is skipped to avoid -EBUSY address conflicts. +*/ +static const struct acpi_device_id i2c_acpi_generic_device_ids[] = { +/* Microsoft UCSI - often paired with vendor-specific UCSI device */ + {"MSFT8000" }, + {} +};
That's not a generic UCSI device. That's the "RhProxy" device unless I'm completely mistaken, and it's meant to be used in Windows to give the user mode access to GPIOs, SPI, I2C and UART:
https://learn.microsoft.com/en-us/windows/uwp/devices-sensors/enable-usermode-access
I think we need to handle that one in drivers/acpi/x86/utils.c like Mika said.
thanks,
Signature · 1 line
heikki
PATCH 2/2 usb: typec: ucsi: add ITE885x I2C transport driver
In reply to Edward BlairAdd a UCSI transport driver for ITE8853/ITE8800-ITE8805 USB Type-C controllers, commonly found on ASUS Z690/Z790/X670E motherboards.
These controllers implement the UCSI protocol over I2C with ITE-proprietary register offsets and dedicated interrupt registers:
- CCI at 0x84, MESSAGE_IN at 0x88, CONTROL at 0x98
- INT_STATUS at 0xBD, INT_ACK at 0xBC
- GPIO interrupt (level-triggered, active-low)
The ITE8853 does not accept PPM_RESET over I2C (the Windows driver handles it internally), so the driver intercepts this command and returns a synthetic reset-complete response.
Tested on ASUS ROG Strix Z790-E Gaming WiFi with ITE8853 at I2C address 0x40 on the DesignWare I2C controller.
--- drivers/usb/typec/ucsi/Kconfig | 11 ++ drivers/usb/typec/ucsi/Makefile | 1 + drivers/usb/typec/ucsi/ucsi_ite.c | 285 ++++++++++++++++++++++++++++++ 3 files changed, 297 insertions(+) create mode 100644 drivers/usb/typec/ucsi/ucsi_ite.c
drivers/usb/typec/ucsi/Kconfig +11 -0
@@ -104,4 +104,15 @@ config UCSI_HUAWEI_GAOKUN To compile the driver as a module, choose M here: the module will be called ucsi_huawei_gaokun. +config UCSI_ITE + tristate "UCSI Interface Driver for ITE885x" + depends on I2C + help + This driver enables UCSI support on platforms that expose an ITE8853 + or ITE8800-ITE8805 USB Type-C controller over I2C, commonly found + on ASUS Z690/Z790/X670E motherboards. + + To compile the driver as a module, choose M here: the module will be + called ucsi_ite. + endif
drivers/usb/typec/ucsi/Makefile +1 -0
@@ -28,3 +28,4 @@ obj-$(CONFIG_UCSI_PMIC_GLINK) += ucsi_glink.o obj-$(CONFIG_CROS_EC_UCSI) += cros_ec_ucsi.o obj-$(CONFIG_UCSI_LENOVO_YOGA_C630) += ucsi_yoga_c630.o obj-$(CONFIG_UCSI_HUAWEI_GAOKUN) += ucsi_huawei_gaokun.o +obj-$(CONFIG_UCSI_ITE) += ucsi_ite.o
drivers/usb/typec/ucsi/ucsi_ite.c new file +285 -0
285 lines not on this page · raw message
Signature · 1 line
2.53.0
Heikki Krogerus
maintainerRe: [PATCH 2/2] usb: typec: ucsi: add ITE885x I2C transport driver
Hi,
drivers/usb/typec/ucsi/ucsi_ite.c line 13
Quoted 13 lines
drivers/usb/typec/ucsi/ucsi_ite.c new file +13
-0+// SPDX-License-Identifier: GPL-2.0-only +/* +* UCSI I2C transport driver for ITE885x USB-C controllers +* +* ITE8853/ITE8800-ITE8805 are UCSI-compliant USB-C controllers found on +* ASUS Z690/Z790/X670E motherboards. They communicate via I2C with +* ITE-proprietary register offsets and interrupt registers. +* +* Note: Some BIOS implementations declare both MSFT8000 (generic UCSI) and +* ITE8853 (vendor-specific) ACPI devices at the same I2C address. The i2c +* core skips the generic device when a vendor-specific sibling exists, +* allowing this driver to bind to the ITE8853 client with proper IRQ. +*/
Besides the above comment, this looks okay to me.
But couldn't you use the resource managed version to request the irq:devm_request_threaded_irq() ?
thanks,
Signature · 1 line
heikki
Re: [PATCH 2/2] usb: typec: ucsi: add ITE885x I2C transport driver
Quoted 4 lines · Heikki Krogerus
Besides the above comment, this looks okay to me.
But couldn't you use the resource managed version to request the
irq:devm_request_threaded_irq()?
Thanks for the review. Will switch to devm_request_threaded_irq() and update the header comment for v2. As you noted on patch 1/2, MSFT8000 is RhProxy, not generic UCSI.
Thanks,
Edward