]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: tegra: enable DFU too
authorStephen Warren <swarren@nvidia.com>
Fri, 25 Jul 2014 23:16:54 +0000 (17:16 -0600)
committerTom Warren <twarren@nvidia.com>
Mon, 18 Aug 2014 23:57:03 +0000 (16:57 -0700)
Enable DFU protocol support (via the "dfu" command) on Tegra boards where
USB device/gadget mode is enabled.

Note that for DFU to operate correctly on Tegra, we still need some DFU
fixes/enhancements that are going through the DFU -> USB trees. However,
the code builds just fine without those changes, and applying this patch
now will allow both sets of patches to meet in the main U-Boot tree much
more quickly.

In order to run test/dfu/dfu_gadget_test.sh, you would need to add the
following to the board configuration:

CONFIG_EXT4_WRITE
CONFIG_CMD_EXT4_WRITE

However, I haven't enabled those here, since I believe the main use-case
for DFU on Tegra is raw flash writing, rather than filesystem access, so
we don't need the additional code-size hit. However, I could be persuaded
otherwise! We should probably add a separate test script for raw flash
access.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
include/configs/beaver.h
include/configs/jetson-tk1.h
include/configs/tegra-common-usb-gadget.h [moved from include/configs/tegra-common-ums.h with 57% similarity]
include/configs/venice2.h

index ae831127985ff5d575cf34a8759cc1d269f52af4..d8ed717f5a4e2dfed12c2e6336fef1842bfc3bb8 100644 (file)
@@ -88,7 +88,7 @@
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_DHCP
 
-#include "tegra-common-ums.h"
+#include "tegra-common-usb-gadget.h"
 #include "tegra-common-post.h"
 
 #endif /* __CONFIG_H */
index 0b9e5b699fa67fd70ec211afbfd8a436b9ee287f..d03a66cd224015041733fff1095affa9a4033e0b 100644 (file)
@@ -75,7 +75,7 @@
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_DHCP
 
-#include "tegra-common-ums.h"
+#include "tegra-common-usb-gadget.h"
 #include "tegra-common-post.h"
 
 #endif /* __CONFIG_H */
similarity index 57%
rename from include/configs/tegra-common-ums.h
rename to include/configs/tegra-common-usb-gadget.h
index 578ca68b578181db7cb09ac6b81a0fbbf789977e..287460c132bc5068199447dfb0d8e039d8f52ca0 100644 (file)
@@ -5,11 +5,11 @@
  * SPDX-License-Identifier:     GPL-2.0
  */
 
-#ifndef _TEGRA_COMMON_UMS_H_
-#define _TEGRA_COMMON_UMS_H_
+#ifndef _TEGRA_COMMON_USB_GADGET_H_
+#define _TEGRA_COMMON_USB_GADGET_H_
 
 #ifndef CONFIG_SPL_BUILD
-/* USB gadget, and mass storage protocol */
+/* USB gadget mode support*/
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_VBUS_DRAW    2
 #define CONFIG_CI_UDC
 #define CONFIG_G_DNL_PRODUCT_NUM 0x701A
 #define CONFIG_G_DNL_MANUFACTURER "NVIDIA"
 #define CONFIG_USBDOWNLOAD_GADGET
+/* USB mass storage protocol */
 #define CONFIG_USB_GADGET_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
+/* DFU protocol */
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
+#define CONFIG_CMD_DFU
+#ifdef CONFIG_MMC
+#define CONFIG_DFU_MMC
+#endif
+#ifdef CONFIG_SPI_FLASH
+#define CONFIG_DFU_SF
+#endif
 #endif
 
-#endif /* _TEGRA_COMMON_UMS_H */
+#endif /* _TEGRA_COMMON_USB_GADGET_H_ */
index c4a1b94b98e13a35c7c06f6a488f5ee05fd44223..6d4e9991a130db00a53a9ed0eb9daf95cc4de430 100644 (file)
@@ -75,7 +75,7 @@
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_DHCP
 
-#include "tegra-common-ums.h"
+#include "tegra-common-usb-gadget.h"
 #include "tegra-common-post.h"
 
 #endif /* __CONFIG_H */