Re: query on UCSI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Mar 07, 2017 at 12:39:39AM +0530, Shah, Nehal-bakulchandra wrote:
> Hi Heikki ,
> 
> 
> Thanks for the prompt reply.
> If i understood correctly the current driver(drivers/usb/misc/ucsi.c) supports
> the OPM and rest all is taken care by EC FW  with BIOS .
> In ucsi.c file i did not find any mailbox related code. Am I missing something
> here?

The driver maps the region for the mailbox on line 478.

OPM needs to be able to access to the mailbox as normal Memory
resource. The UCSI BIOS implementation guide, in the example for the
requirements, only shows the OperationRegion, but that is not enough
of course as OperationRegions provides access to some data for other
ACPI methods, not for the OS.

Here's ASL snippet that should give an idea about how the device
object for UCSI should look like:

Device (<what ever>)
{
        Name (_HID, EISAID("USBC000"))
        Name (_CID, EISAID("PNP0CA0"))
        Name (_UID, 1)
        Name (_DDN, "USB Type-C")
        Name (_ADR, 0x0)
        Name (_DEP, Package (0x01)
        {
                // You probable want to have dependency on EC.
        })
        ...

        // This will give the OPM (the driver) access to the mailbox
        Name (CRS, ResourceTemplate()
        {
                Memory32Fixed(ReadWrite, 0x12345678, 0x00001000, )
        })

        // This will just give other ACPI methods access to the mailbox
        OperationRegion (USBC, SystemMemory, 0x12345678, 0x30)
        Field (USBC,AnyAcc,Lock,Preserve)
        {
                VERS,  16, // PPM->OPM Version
                    ,  16, // Reserved
                CCI,   32, // PPM->OPM CCI indicator
                CTRL,  64, // OPM->PPM Control message
                MSGI, 128, // OPM->PPM Message In
                MSGO, 128, // PPM->OPM Message Out
        }

        Method (_DSM, 4, Serialized)
        {
                If (LEqual(Arg0, ToUUID ("6f8398c2-7ca4-11e4-ad36-631042b5008f")))
                {
                        // Here you will probable need the OpRegion
                        ...
                }
        }
}


I hope that helps!


Br,

-- 
heikki
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux