Skip to content

Commit

Permalink
UPSTREAM: toradex: imx6: Move g_dnl_bind_fixup() into common SPL code
Browse files Browse the repository at this point in the history
Instead of having every board file to add its own g_dnl_bind_fixup()
implementation, move it to the common imx6 SPL code.

Change-Id: Id8ee1026cbd8cde4b0711829373f99ba58a6363b
Signed-off-by: Fabio Estevam <[email protected]>
Reviewed-by: Łukasz Majewski <[email protected]>
Signed-off-by: Frank Wang <[email protected]>
(cherry picked from commit 511db3b)
  • Loading branch information
Fabio Estevam authored and Frank Wang committed Jan 7, 2020
1 parent 68e15c2 commit f9cd3a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
10 changes: 10 additions & 0 deletions arch/arm/mach-imx/spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <asm/spl.h>
#include <spl.h>
#include <asm/mach-imx/hab.h>
#include <g_dnl.h>

DECLARE_GLOBAL_DATA_PTR;

Expand Down Expand Up @@ -82,6 +83,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)
Expand Down
13 changes: 0 additions & 13 deletions board/toradex/apalis_imx6/apalis_imx6.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <dm/platform_data/serial_mxc.h>
#include <dm/platdata.h>
#include <fsl_esdhc.h>
#include <g_dnl.h>
#include <i2c.h>
#include <imx_thermal.h>
#include <linux/errno.h>
Expand Down Expand Up @@ -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 = {
Expand Down
13 changes: 0 additions & 13 deletions board/toradex/colibri_imx6/colibri_imx6.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <dm/platform_data/serial_mxc.h>
#include <dm/platdata.h>
#include <fsl_esdhc.h>
#include <g_dnl.h>
#include <i2c.h>
#include <imx_thermal.h>
#include <linux/errno.h>
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit f9cd3a6

Please sign in to comment.