From d8cbdd7d92f90d265d6f519fb6d8b9ea74f5e2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Wed, 7 May 2025 13:05:16 +0200 Subject: [PATCH] imx8mp-evk: Add USB and HDMI support --- doc/ChangeLog.md | 1 + .../board/freescale-imx8mp-evk/imx8mp-evk.mk | 20 ++++ .../dts/freescale/imx8mp-evk.dts | 103 ++++++++++++++++++ 3 files changed, 124 insertions(+) diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index fa5e90a1..a1ba0174 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -11,6 +11,7 @@ All notable changes to the project are documented in this file. - Upgrade sysrepo to 3.6.11 - Upgrade netopeer2 (NETCONF) to 2.4.1 - Add documentation on Infix upgrading and downgrading, issue #1009 +- Add HDMI and USB support for iMX8MP-evk ### Fixes diff --git a/package/board/freescale-imx8mp-evk/imx8mp-evk.mk b/package/board/freescale-imx8mp-evk/imx8mp-evk.mk index 7f060134..b959949c 100644 --- a/package/board/freescale-imx8mp-evk/imx8mp-evk.mk +++ b/package/board/freescale-imx8mp-evk/imx8mp-evk.mk @@ -20,6 +20,26 @@ define FREESCALE_IMX8MP_EVK_LINUX_CONFIG_FIXUPS $(call KCONFIG_ENABLE_OPT,CONFIG_INTERCONNECT_IMX) $(call KCONFIG_ENABLE_OPT,CONFIG_INTERCONNECT_IMX8MP) $(call KCONFIG_ENABLE_OPT,CONFIG_REALTEK_PHY) +# For X + $(call KCONFIG_ENABLE_OPT,CONFIG_DRM) + $(call KCONFIG_ENABLE_OPT,CONFIG_DRM_ETNAVIV) + $(call KCONFIG_ENABLE_OPT,CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE) + $(call KCONFIG_ENABLE_OPT,CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY) + $(call KCONFIG_ENABLE_OPT,CONFIG_DRM_IMX8MP_HDMI_PVI) + $(call KCONFIG_ENABLE_OPT,CONFIG_DRM_IMX_LCDIF) + $(call KCONFIG_ENABLE_OPT,CONFIG_INPUT_MOUSE) + $(call KCONFIG_ENABLE_OPT,CONFIG_INPUT_MOUSEDEV) + $(call KCONFIG_ENABLE_OPT,CONFIG_HID_GENERIC) + +# For USB + $(call KCONFIG_DISABLE_OPT,CONFIG_USB) + $(call KCONFIG_ENABLE_OPT,CONFIG_USB) + $(call KCONFIG_ENABLE_OPT,CONFIG_USB_DWC3) + $(call KCONFIG_DISABLE_OPT,CONFIG_USB_DWC3_GADGET) + $(call KCONFIG_ENABLE_OPT,CONFIG_USB_DWC3_HOST) + $(call KCONFIG_ENABLE_OPT,CONFIG_ARM_IMX_BUS_DEVFREQ) + $(call KCONFIG_ENABLE_OPT,CONFIG_TYPEC_TCPCI) + $(call KCONFIG_ENABLE_OPT,CONFIG_TYPEC_SWITCH_GPIO) endef $(eval $(ix-board)) diff --git a/src/board/freescale-imx8mp-evk/dts/freescale/imx8mp-evk.dts b/src/board/freescale-imx8mp-evk/dts/freescale/imx8mp-evk.dts index aa5ef7d6..8c9010cf 100644 --- a/src/board/freescale-imx8mp-evk/dts/freescale/imx8mp-evk.dts +++ b/src/board/freescale-imx8mp-evk/dts/freescale/imx8mp-evk.dts @@ -1,6 +1,109 @@ #include +#include +&usb3_phy0 { + + status = "okay"; +}; +&iomuxc { + pinctrl_typec_mux: typec1muxgrp { + fsl,pins = < + MX8MP_IOMUXC_SAI1_MCLK__GPIO4_IO20 0x16 + >; + }; + pinctrl_typec: typec1grp { + fsl,pins = < + MX8MP_IOMUXC_SAI1_TXD7__GPIO4_IO19 0x1c4 + >; + }; +}; + +&i2c2 { + ptn5110: tcpc@50 { + compatible = "nxp,ptn5110"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_typec>; + reg = <0x50>; + interrupt-parent = <&gpio4>; + interrupts = <19 8>; + + port { + typec_dr_sw: endpoint { + remote-endpoint = <&usb3_drd_sw>; + }; + }; + + usb_con: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + power-role = "dual"; + data-role = "dual"; + try-power-role = "sink"; + source-pdos = ; + sink-pdos = ; + op-sink-microwatt = <15000000>; + self-powered; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + typec_con_ss: endpoint { + remote-endpoint = <&usb3_data_ss>; + }; + }; + }; + }; + }; +}; +&usb3_phy0 { + fsl,phy-tx-vref-tune = <0xe>; + fsl,phy-tx-preemp-amp-tune = <3>; + fsl,phy-tx-vboost-level = <5>; + fsl,phy-comp-dis-tune = <7>; + fsl,pcs-tx-deemph-3p5db = <0x21>; + fsl,phy-pcs-tx-swing-full = <0x7f>; + status = "okay"; +}; + +&usb3_0 { + status = "okay"; +}; + +&usb_dwc3_0 { + dr_mode = "otg"; + hnp-disable; + srp-disable; + adp-disable; + usb-role-switch; + role-switch-default-mode = "none"; + snps,dis-u1-entry-quirk; + snps,dis-u2-entry-quirk; + status = "okay"; + + port { + usb3_drd_sw: endpoint { + remote-endpoint = <&typec_dr_sw>; + }; + }; +}; / { + gpio-sbu-mux { + compatible = "gpio-sbu-mux"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_typec_mux>; + switch-gpios = <&gpio4 20 GPIO_ACTIVE_LOW>; + orientation-switch; + + port { + usb3_data_ss: endpoint { + remote-endpoint = <&typec_con_ss>; + }; + }; + }; chosen { infix { /* "admin" */