From 39446bcefafa178e4072bd28c4f8325835d473d2 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Fri, 25 Jul 2014 17:16:54 -0600 Subject: ARM: tegra: enable DFU too 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 Acked-by: Simon Glass Signed-off-by: Tom Warren --- include/configs/beaver.h | 2 +- include/configs/jetson-tk1.h | 2 +- include/configs/tegra-common-ums.h | 26 ---------------------- include/configs/tegra-common-usb-gadget.h | 37 +++++++++++++++++++++++++++++++ include/configs/venice2.h | 2 +- 5 files changed, 40 insertions(+), 29 deletions(-) delete mode 100644 include/configs/tegra-common-ums.h create mode 100644 include/configs/tegra-common-usb-gadget.h (limited to 'include/configs') diff --git a/include/configs/beaver.h b/include/configs/beaver.h index ae83112..d8ed717 100644 --- a/include/configs/beaver.h +++ b/include/configs/beaver.h @@ -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 */ diff --git a/include/configs/jetson-tk1.h b/include/configs/jetson-tk1.h index 0b9e5b6..d03a66c 100644 --- a/include/configs/jetson-tk1.h +++ b/include/configs/jetson-tk1.h @@ -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 */ diff --git a/include/configs/tegra-common-ums.h b/include/configs/tegra-common-ums.h deleted file mode 100644 index 578ca68..0000000 --- a/include/configs/tegra-common-ums.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * (C) Copyright 2014 - * NVIDIA Corporation - * - * SPDX-License-Identifier: GPL-2.0 - */ - -#ifndef _TEGRA_COMMON_UMS_H_ -#define _TEGRA_COMMON_UMS_H_ - -#ifndef CONFIG_SPL_BUILD -/* USB gadget, and mass storage protocol */ -#define CONFIG_USB_GADGET -#define CONFIG_USB_GADGET_VBUS_DRAW 2 -#define CONFIG_CI_UDC -#define CONFIG_CI_UDC_HAS_HOSTPC -#define CONFIG_USB_GADGET_DUALSPEED -#define CONFIG_G_DNL_VENDOR_NUM 0x0955 -#define CONFIG_G_DNL_PRODUCT_NUM 0x701A -#define CONFIG_G_DNL_MANUFACTURER "NVIDIA" -#define CONFIG_USBDOWNLOAD_GADGET -#define CONFIG_USB_GADGET_MASS_STORAGE -#define CONFIG_CMD_USB_MASS_STORAGE -#endif - -#endif /* _TEGRA_COMMON_UMS_H */ diff --git a/include/configs/tegra-common-usb-gadget.h b/include/configs/tegra-common-usb-gadget.h new file mode 100644 index 0000000..287460c --- /dev/null +++ b/include/configs/tegra-common-usb-gadget.h @@ -0,0 +1,37 @@ +/* + * (C) Copyright 2014 + * NVIDIA Corporation + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#ifndef _TEGRA_COMMON_USB_GADGET_H_ +#define _TEGRA_COMMON_USB_GADGET_H_ + +#ifndef CONFIG_SPL_BUILD +/* USB gadget mode support*/ +#define CONFIG_USB_GADGET +#define CONFIG_USB_GADGET_VBUS_DRAW 2 +#define CONFIG_CI_UDC +#define CONFIG_CI_UDC_HAS_HOSTPC +#define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_G_DNL_VENDOR_NUM 0x0955 +#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_USB_GADGET_H_ */ diff --git a/include/configs/venice2.h b/include/configs/venice2.h index c4a1b94..6d4e999 100644 --- a/include/configs/venice2.h +++ b/include/configs/venice2.h @@ -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 */ -- cgit v1.1