Commit Graph

5 Commits

Author SHA1 Message Date
Ye Li 69dfae092f MLK-20559-7 tcpc: Bypass the vbus disable for SPL
The SPL won't use host mode, and the tcpc is default set as device mode.
So we don't need to access tcpc in SPL.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Frank Li 7c3d2a17bf MLK-19181-2: i.MX850: SPL enable usb support
Enable DWC3 USB support at i.MX850D platform

Signed-off-by: Frank Li <Frank.Li@nxp.com>
2018-08-10 12:10:31 -05:00
Ye Li baf8c71cb5 MLK-18437-2 tcpc: Add external PD switch call back
Introduce a callback function to setup external PD switch. When PD
process is enabled, we call this function only when SINK_VBUS is enabled
to avoid system power shut down.
When PD process is disabled, since the tcpc and external PD switch may
still in dead battery mode, set them to exit dead battery.

This patch is used to fix two issues on iMX8MM EVK:

1. When power on the board, by default the PTN5110 and NX20P3483 will
   enter dead battery mode. But for some cases, like timing issue for PTN5110
   and NX20P3483 (refer rework instructions CQ6), and when dual port are plugin
   power sources. There are possibility the PTN5110 does not enter dead battery mode,
   but NX20P3483 is in dead battery. So for the USB2 primary power port, we has to check
   SINK_VBUS before NX20P3483 exits dead battery, otherwise the system power will shut down

2. For the USB1 port, when dual port are plugin power sources. We need to set both
   PTN5110 and NX20P3483 exit dead battery. Otherwise this port can't work for normal
   host/device mode.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 30004c6b35a5f0b8460f534d324f9bde01325373)
2018-06-13 19:52:30 -07:00
Ye Li 2ce6011258 MLK-18289-1 tcpc: Update driver to support two ports logic
On iMX8MM EVK, there are two USB ports. Both can support USB PD, but
with USB2 has HW priority.

So we Change tcpc_pd_sink_check_charging to public function and
use it to know whether the USB tcpc is power charging.

Additional, add disable_pd to init config. So we can disable PD session
for uncharged or lower priority port.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 867b0263d60bb5385b09cfa21d6f620bea855075)
2018-05-23 04:15:54 -07:00
Ye Li b81241ee36 MLK-18160 tcpc: Add driver for USB typec port controller (TCPC)
Add an simple driver for USB typec port controller in freescale common codes.
The functionalities in this driver include:

1. Support to set UFP mode, when running as device mode, the
   board level codes can use it to configure the TCPC port to UFP mode.

2. Support to set DFP mode for USB host.

3. Support PD charge with setup PD connection and send/receive PD messages
   to negotiate a proper voltage and current.

4. Support power source with 2 stages of capability. Some power delivery source
   send the source capability by 2 stages: 1st stage send the source capability
   message with only basic 5V PDO, after the 5V power session setup, 2nd stage
   it will send full source capabilities with all PDOs it can support, in this
   case, we should go on to process the following PD source cap to have a new
   power session setup.

Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:14 -07:00