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: Ye Li <ye.li@nxp.com>
Acked-by: Jun Li <jun.li@nxp.com>
config SYS_CONFIG_NAME
default "imx8mq_evk"
+source "board/freescale/common/Kconfig"
+
endif
#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>
}
#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();
setup_fec();
#endif
+#ifdef CONFIG_USB_TCPC
+ setup_typec();
+#endif
return 0;
}
CONFIG_FIT=y
CONFIG_SPL_FIT=y
CONFIG_SPL_LOAD_FIT=y
+CONFIG_USB_TCPC=y