diff options
Diffstat (limited to 'board/freescale/imx8mq_evk/imx8m_evk.c')
-rw-r--r-- | board/freescale/imx8mq_evk/imx8m_evk.c | 88 |
1 files changed, 84 insertions, 4 deletions
diff --git a/board/freescale/imx8mq_evk/imx8m_evk.c b/board/freescale/imx8mq_evk/imx8m_evk.c index 618f77c605..26191c4db8 100644 --- a/board/freescale/imx8mq_evk/imx8m_evk.c +++ b/board/freescale/imx8mq_evk/imx8m_evk.c @@ -1,6 +1,6 @@ /* * Copyright 2016 Freescale Semiconductor, Inc. - * Copyright 2017 NXP + * Copyright 2017-2018 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -20,9 +20,13 @@ #include <asm/imx-common/gpio.h> #include <asm/imx-common/mxc_i2c.h> #include <asm/arch/clock.h> +#include <asm/imx-common/video.h> +#include <asm/arch/video_common.h> #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> @@ -112,7 +116,8 @@ static iomux_v3_cfg_t const fec1_rst_pads[] = { static void setup_iomux_fec(void) { - imx_iomux_v3_setup_multiple_pads(fec1_rst_pads, ARRAY_SIZE(fec1_rst_pads)); + imx_iomux_v3_setup_multiple_pads(fec1_rst_pads, + ARRAY_SIZE(fec1_rst_pads)); gpio_request(IMX_GPIO_NR(1, 9), "fec1_rst"); gpio_direction_output(IMX_GPIO_NR(1, 9), 0); @@ -214,9 +219,8 @@ int board_usb_init(int index, enum usb_init_type init) int board_usb_cleanup(int index, enum usb_init_type init) { - if (index == 0 && init == USB_INIT_DEVICE) { + if (index == 0 && init == USB_INIT_DEVICE) dwc3_uboot_exit(index); - } imx8m_usb_power(index, false); @@ -224,6 +228,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 +262,9 @@ int board_init(void) setup_fec(); #endif +#ifdef CONFIG_USB_TCPC + setup_typec(); +#endif return 0; } @@ -262,3 +295,50 @@ int is_recovery_key_pressing(void) } #endif /*CONFIG_ANDROID_RECOVERY*/ #endif /*CONFIG_FSL_FASTBOOT*/ + +#if defined(CONFIG_VIDEO_IMXDCSS) + +struct display_info_t const displays[] = {{ + .bus = 0, /* Unused */ + .addr = 0, /* Unused */ + .pixfmt = GDF_32BIT_X888RGB, + .detect = NULL, + .enable = NULL, +#ifndef CONFIG_VIDEO_IMXDCSS_1080P + .mode = { + .name = "HDMI", /* 720P60 */ + .refresh = 60, + .xres = 1280, + .yres = 720, + .pixclock = 13468, /* 74250 kHz */ + .left_margin = 110, + .right_margin = 220, + .upper_margin = 5, + .lower_margin = 20, + .hsync_len = 40, + .vsync_len = 5, + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, + .vmode = FB_VMODE_NONINTERLACED + } +#else + .mode = { + .name = "HDMI", /* 1080P60 */ + .refresh = 60, + .xres = 1920, + .yres = 1080, + .pixclock = 6734, /* 148500 kHz */ + .left_margin = 148, + .right_margin = 88, + .upper_margin = 36, + .lower_margin = 4, + .hsync_len = 44, + .vsync_len = 5, + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, + .vmode = FB_VMODE_NONINTERLACED + } +#endif +} }; +size_t display_count = ARRAY_SIZE(displays); + +#endif /* CONFIG_VIDEO_IMXDCSS */ + |