zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.83k stars 6.6k forks source link

Add generic Type-C "port manager" support #18579

Open raveslave opened 5 years ago

raveslave commented 5 years ago

Add support for USB Type-C controllers with PD

This is useful when designing products using USB-C connectors needing additional support like higher current, role-switching "host/device", power source/sink or simply supporting vendor packages over PD (using the CC pins).

The driver should implement support for

The driver should basically serve as a state machine that orchestrates connection-events, data and power roles as well as runtime changes like role-swap or power-updates.

The connection between the TCPM (running in Zephyr) and the TCPC (vendor IC) is defined as the USB Type-C Port Controller Interface, TCPCI. see: https://www.usb.org/document-library/usb-type-cr-port-controller-interface-specification

Event and control needs

The low level driver should be responsible for


image
keith-zephyr commented 3 years ago

Google is in the planning process of upstreaming the USB-C stack used on Chromebooks into Zephyr.

The is a bit of work needed to reorganize the code to conform to Zephyr's structure, so if anyone has specific features like would like prioritized, please add a comment to this issue.

dzarda commented 3 years ago

@keith-zephyr That's a nice bit of news. Last time I checked there was no Sink-only support in the Chrome EC codebase. However that's a major case for Zephyr devices. Would that be available?

keith-zephyr commented 3 years ago

Yes, we plan to provide source-only, sink-only, and dual-role port operation. We also support try source and try sink operation for dual-role ports.

keith-zephyr commented 3 years ago

This github issue has been created that will cover the work of moving Google's USB-C stack to Zephyr. We welcome comments and suggestions.