From 511db3bf5a27a2f7eca0f60b6adb1eff74bd6df6 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 5 Sep 2017 20:46:39 -0300 Subject: [PATCH] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Instead of having every board file to add its own g_dnl_bind_fixup() implementation, move it to the common imx6 SPL code. Signed-off-by: Fabio Estevam Reviewed-by: Łukasz Majewski --- arch/arm/mach-imx/spl.c | 10 ++++++++++ board/toradex/apalis_imx6/apalis_imx6.c | 13 ------------- board/toradex/colibri_imx6/colibri_imx6.c | 13 ------------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 82ea6b85d6..5944f99482 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -14,6 +14,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -94,6 +95,15 @@ u32 spl_boot_device(void) } return BOOT_DEVICE_NONE; } + +#ifdef CONFIG_SPL_USB_GADGET_SUPPORT +int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) +{ + put_unaligned(CONFIG_G_DNL_PRODUCT_NUM + 0xfff, &dev->idProduct); + + return 0; +} +#endif #endif #if defined(CONFIG_SPL_MMC_SUPPORT) diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index ebc6c12cbc..628a61dae0 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -1224,18 +1223,6 @@ void reset_cpu(ulong addr) { } -#ifdef CONFIG_SPL_USB_GADGET_SUPPORT -int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) -{ - unsigned short usb_pid; - - usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff; - put_unaligned(usb_pid, &dev->idProduct); - - return 0; -} -#endif - #endif static struct mxc_serial_platdata mxc_serial_plat = { diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index 669d9123ca..756e3f39df 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -1108,18 +1107,6 @@ void reset_cpu(ulong addr) { } -#ifdef CONFIG_SPL_USB_GADGET_SUPPORT -int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) -{ - unsigned short usb_pid; - - usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff; - put_unaligned(usb_pid, &dev->idProduct); - - return 0; -} -#endif - #endif static struct mxc_serial_platdata mxc_serial_plat = { -- 2.30.2