Re: ucsi and DRD controller interaction

Heikki Krogerus
2020-04-27T12:00:36Z

On Wed, Apr 22, 2020 at 08:23:54PM +0530, Shah, Nehal-bakulchandra wrote:
> > Can you still influence what goes to your ACPI tables, or are we
> > talking about products that are already on the market?
>
> Yes still it is in development phase so i can work out with BIOS team for the same. When you say description of connection ,something like this should be part of _DSD method right? (i.e from below dts
> to _DSD of ACPI)
>
>  usb_con: connector {
> compatible = "usb-c-connector";
>  label = "USB-C";
>  data-role = "dual";
>  power-role = "dual";
>  try-power-role = "sink";
>  source-pdos = <PDO_FIXED(5000, 500, PDO_FIXED_USB_COMM)>;
>  sink-pdos = <PDO_FIXED(5000, 500, PDO_FIXED_USB_COMM)
>  PDO_VAR(5000, 5000, 1000)>;
>  op-sink-microwatt = <10000000>;
>  };

Here's how the ASL for the _DSD should look like. I don't know how
are all these components placed on your platform, so I'm just assuming
that your I2C host is under PCI0, as well as your DWC3 controller.
It's just an example, but hopefully you get the point from it:

/*
* I2C1 is the I2C host, and PDC1 is the USB PD Controller (I2C slave device).
*/
Scope (\_SB.PCI0.I2C1.PDC1)
{
/* Each connector should have its own ACPI device entry (node). */
Device (CON0)
{
Name (_ADR, 0)

Name (_DSD, Package () {
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package() {
Package () {"usb-role-switch", \_SB.PCI0.DWC3},
}
})
}
}

So that property "usb-role-switch" has reference to the DWC3 node as
its value. That's what we are after here. If you have that property,
the subsystem will find the USB controller for you.

If you need for example the properties for the roles, then the _DSD
would look like this:

Name (_DSD, Package () {
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package() {
Package () {"usb-role-switch", \_SB.PCI0.DWC3},
Package () {"power-role", "dual"},
Package () {"data-role", "dual"},
}
})

and so on...

Thanks,

--
heikki