From 957fd8c849142802c4f0b9479be607c8c5ed1f7a Mon Sep 17 00:00:00 2001 From: Ye Li Date: Sun, 21 Apr 2019 21:06:13 -0700 Subject: [PATCH] MLK-21846-2 imx8mq_evk: Enable USB SDP in SPL Enable the SPL SDP driver and SPL gadget drivers on iMX8MQ EVK board. Signed-off-by: Ye Li --- board/freescale/imx8mq_evk/spl.c | 10 ++++++++++ configs/imx8mq_evk_defconfig | 12 ++++++++++++ include/configs/imx8mq_evk.h | 22 +++++----------------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/board/freescale/imx8mq_evk/spl.c b/board/freescale/imx8mq_evk/spl.c index fd70a41cac..7439eb33e5 100644 --- a/board/freescale/imx8mq_evk/spl.c +++ b/board/freescale/imx8mq_evk/spl.c @@ -193,6 +193,16 @@ int power_init_board(void) void spl_board_init(void) { +#ifndef CONFIG_SPL_USB_SDP_SUPPORT + /* Serial download mode */ + if (is_usb_boot()) { + puts("Back to ROM, SDP\n"); + restore_boot_params(); + } +#endif + + init_usb_clk(); + puts("Normal Boot\n"); } diff --git a/configs/imx8mq_evk_defconfig b/configs/imx8mq_evk_defconfig index 12f1e3363a..7c780739a1 100644 --- a/configs/imx8mq_evk_defconfig +++ b/configs/imx8mq_evk_defconfig @@ -56,3 +56,15 @@ CONFIG_SF_DEFAULT_MODE=0 CONFIG_VIDEO=y CONFIG_VIDEO_IMX8_HDMI=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x0525 +CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_USB_GADGET_MANUFACTURER="FSL" +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_SPL_USB_GADGET=y +CONFIG_SPL_USB_SDP_SUPPORT=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_IMX8M=y +CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GADGET=y diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h index af587440f9..89b9c71431 100644 --- a/include/configs/imx8mq_evk.h +++ b/include/configs/imx8mq_evk.h @@ -243,32 +243,20 @@ /* USB configs */ #ifndef CONFIG_SPL_BUILD -#define CONFIG_USB_XHCI_IMX8M -#define CONFIG_USB_XHCI_DWC3 -#define CONFIG_USB_XHCI_HCD -#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 - #define CONFIG_CMD_USB #define CONFIG_USB_STORAGE -#define CONFIG_USB_DWC3 -#define CONFIG_USB_DWC3_GADGET -#define CONFIG_USBD_HS - -#define CONFIG_USB_GADGET #define CONFIG_CMD_USB_MASS_STORAGE #define CONFIG_USB_GADGET_MASS_STORAGE -#define CONFIG_USB_GADGET_DOWNLOAD -#define CONFIG_USB_GADGET_VBUS_DRAW 2 -#define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_FUNCTION_MASS_STORAGE -#define CONFIG_USB_GADGET_VENDOR_NUM 0x0525 -#define CONFIG_USB_GADGET_PRODUCT_NUM 0xa4a5 -#define CONFIG_USB_GADGET_MANUFACTURER "FSL" - #endif +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 + +#define CONFIG_USBD_HS +#define CONFIG_USB_GADGET_VBUS_DRAW 2 + #define CONFIG_OF_SYSTEM_SETUP #ifndef CONFIG_SPL_BUILD -- 2.17.1