apalis/colibri_imx6: use independent USB PID for SPL
authorStefan Agner <stefan.agner@toradex.com>
Wed, 16 Aug 2017 18:00:56 +0000 (11:00 -0700)
committerStefano Babic <sbabic@denx.de>
Wed, 23 Aug 2017 08:41:58 +0000 (10:41 +0200)
Use a completely independent USB Product ID for SPL. This allows
to differentiate a SDP running in SPL and SDP running in a U-Boot
which could not read the config block successfully.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Ɓukasz Majewski <lukma@denx.de>
board/toradex/apalis_imx6/apalis_imx6.c
board/toradex/colibri_imx6/colibri_imx6.c

index 7a3e493faf168a908f73463501d434f8cb9da1a1..2fd96232bdf7420e9c2c57a0151774efac9d8125 100644 (file)
@@ -29,6 +29,7 @@
 #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>
@@ -1234,6 +1235,18 @@ 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 = {
index dbcd2337829dbfb62231b34d5055c0927eea0d37..d30391fa6363e7da0f9307659a144cdda1111ade 100644 (file)
@@ -28,6 +28,7 @@
 #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>
@@ -1118,6 +1119,18 @@ 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 = {