Commit 46cb4678 authored by Ye Li's avatar Ye Li

MLK-17313-3 imx8mq_evk: Add USB PD power sink support

Enable the TCPC driver for i.MX8MQ EVK board. When booting with dead battery,
the TCPC driver will setup USB PD connection to negotiate the power with PD
power charger.
Signed-off-by: 's avatarYe Li <ye.li@nxp.com>
Acked-by: 's avatarJun Li <jun.li@nxp.com>
parent 6757824c
......@@ -9,4 +9,6 @@ config SYS_VENDOR
config SYS_CONFIG_NAME
default "imx8mq_evk"
source "board/freescale/common/Kconfig"
endif
......@@ -23,6 +23,8 @@
#include <spl.h>
#include <power/pmic.h>
#include <power/pfuze100_pmic.h>
#include <dm.h>
#include "../common/tcpc.h"
#include "../common/pfuze.h"
#include <usb.h>
#include <dwc3-uboot.h>
......@@ -224,6 +226,32 @@ int board_usb_cleanup(int index, enum usb_init_type init)
}
#endif
#ifdef CONFIG_USB_TCPC
struct tcpc_port port;
struct tcpc_port_config port_config = {
.i2c_bus = 0,
.addr = 0x50,
.port_type = TYPEC_PORT_UFP,
.max_snk_mv = 20000,
.max_snk_ma = 3000,
.max_snk_mw = 15000,
.op_snk_mv = 9000,
};
static int setup_typec(void)
{
int ret;
ret = tcpc_init(&port, port_config, NULL);
if (ret) {
printf("%s: tcpc init failed, err=%d\n",
__func__, ret);
}
return ret;
}
#endif
int board_init(void)
{
board_qspi_init();
......@@ -232,6 +260,9 @@ int board_init(void)
setup_fec();
#endif
#ifdef CONFIG_USB_TCPC
setup_typec();
#endif
return 0;
}
......
......@@ -34,3 +34,4 @@ CONFIG_DM_THERMAL=y
CONFIG_FIT=y
CONFIG_SPL_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_USB_TCPC=y
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment