aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-rockchip
diff options
context:
space:
mode:
authorJonas Karlman <jonas@kwiboo.se>2024-03-10 18:50:59 +0000
committerKever Yang <kever.yang@rock-chips.com>2024-03-14 18:19:27 +0800
commit2b6a013caf3ca6daa84a96ee72ea2cb88cf78a8f (patch)
tree3c25ec109b6a206f8a839ec5454e0c1f530a9b59 /arch/arm/mach-rockchip
parent06fac9dd1475fad7016c7ef6c68acdaf48b055b4 (diff)
downloadu-boot-2b6a013caf3ca6daa84a96ee72ea2cb88cf78a8f.zip
u-boot-2b6a013caf3ca6daa84a96ee72ea2cb88cf78a8f.tar.gz
u-boot-2b6a013caf3ca6daa84a96ee72ea2cb88cf78a8f.tar.bz2
rockchip: board: Use a common USB Product ID for UMS
Change to use the common Product ID 0x0010 when the ums command is used. This matches downstream vendor U-Boot and is a Product ID that tools such as rkdeveloptool and RKDevTool will identify as MSC mode. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'arch/arm/mach-rockchip')
-rw-r--r--arch/arm/mach-rockchip/board.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
index 9bd5b14..31a1111 100644
--- a/arch/arm/mach-rockchip/board.c
+++ b/arch/arm/mach-rockchip/board.c
@@ -221,8 +221,23 @@ void enable_caches(void)
#endif
#if IS_ENABLED(CONFIG_USB_GADGET)
-#if IS_ENABLED(CONFIG_USB_GADGET_DWC2_OTG) && !IS_ENABLED(CONFIG_DM_USB_GADGET)
#include <usb.h>
+
+#if IS_ENABLED(CONFIG_USB_GADGET_DOWNLOAD)
+#define ROCKCHIP_G_DNL_UMS_PRODUCT_NUM 0x0010
+
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+ if (!strcmp(name, "usb_dnl_ums"))
+ put_unaligned(ROCKCHIP_G_DNL_UMS_PRODUCT_NUM, &dev->idProduct);
+ else
+ put_unaligned(CONFIG_USB_GADGET_PRODUCT_NUM, &dev->idProduct);
+
+ return 0;
+}
+#endif /* CONFIG_USB_GADGET_DOWNLOAD */
+
+#if IS_ENABLED(CONFIG_USB_GADGET_DWC2_OTG) && !IS_ENABLED(CONFIG_DM_USB_GADGET)
#include <linux/usb/otg.h>
#include <usb/dwc2_udc.h>