Commit 39446bcefafa178e4072bd28c4f8325835d473d2

Authored by Stephen Warren
Committed by Tom Warren
1 parent df3443dfa4

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 <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>

Showing 5 changed files with 40 additions and 29 deletions Side-by-side Diff

include/configs/beaver.h
... ... @@ -88,7 +88,7 @@
88 88 #define CONFIG_CMD_NET
89 89 #define CONFIG_CMD_DHCP
90 90  
91   -#include "tegra-common-ums.h"
  91 +#include "tegra-common-usb-gadget.h"
92 92 #include "tegra-common-post.h"
93 93  
94 94 #endif /* __CONFIG_H */
include/configs/jetson-tk1.h
... ... @@ -75,7 +75,7 @@
75 75 #define CONFIG_CMD_NET
76 76 #define CONFIG_CMD_DHCP
77 77  
78   -#include "tegra-common-ums.h"
  78 +#include "tegra-common-usb-gadget.h"
79 79 #include "tegra-common-post.h"
80 80  
81 81 #endif /* __CONFIG_H */
include/configs/tegra-common-ums.h
1   -/*
2   - * (C) Copyright 2014
3   - * NVIDIA Corporation <www.nvidia.com>
4   - *
5   - * SPDX-License-Identifier: GPL-2.0
6   - */
7   -
8   -#ifndef _TEGRA_COMMON_UMS_H_
9   -#define _TEGRA_COMMON_UMS_H_
10   -
11   -#ifndef CONFIG_SPL_BUILD
12   -/* USB gadget, and mass storage protocol */
13   -#define CONFIG_USB_GADGET
14   -#define CONFIG_USB_GADGET_VBUS_DRAW 2
15   -#define CONFIG_CI_UDC
16   -#define CONFIG_CI_UDC_HAS_HOSTPC
17   -#define CONFIG_USB_GADGET_DUALSPEED
18   -#define CONFIG_G_DNL_VENDOR_NUM 0x0955
19   -#define CONFIG_G_DNL_PRODUCT_NUM 0x701A
20   -#define CONFIG_G_DNL_MANUFACTURER "NVIDIA"
21   -#define CONFIG_USBDOWNLOAD_GADGET
22   -#define CONFIG_USB_GADGET_MASS_STORAGE
23   -#define CONFIG_CMD_USB_MASS_STORAGE
24   -#endif
25   -
26   -#endif /* _TEGRA_COMMON_UMS_H */
include/configs/tegra-common-usb-gadget.h
  1 +/*
  2 + * (C) Copyright 2014
  3 + * NVIDIA Corporation <www.nvidia.com>
  4 + *
  5 + * SPDX-License-Identifier: GPL-2.0
  6 + */
  7 +
  8 +#ifndef _TEGRA_COMMON_USB_GADGET_H_
  9 +#define _TEGRA_COMMON_USB_GADGET_H_
  10 +
  11 +#ifndef CONFIG_SPL_BUILD
  12 +/* USB gadget mode support*/
  13 +#define CONFIG_USB_GADGET
  14 +#define CONFIG_USB_GADGET_VBUS_DRAW 2
  15 +#define CONFIG_CI_UDC
  16 +#define CONFIG_CI_UDC_HAS_HOSTPC
  17 +#define CONFIG_USB_GADGET_DUALSPEED
  18 +#define CONFIG_G_DNL_VENDOR_NUM 0x0955
  19 +#define CONFIG_G_DNL_PRODUCT_NUM 0x701A
  20 +#define CONFIG_G_DNL_MANUFACTURER "NVIDIA"
  21 +#define CONFIG_USBDOWNLOAD_GADGET
  22 +/* USB mass storage protocol */
  23 +#define CONFIG_USB_GADGET_MASS_STORAGE
  24 +#define CONFIG_CMD_USB_MASS_STORAGE
  25 +/* DFU protocol */
  26 +#define CONFIG_DFU_FUNCTION
  27 +#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
  28 +#define CONFIG_CMD_DFU
  29 +#ifdef CONFIG_MMC
  30 +#define CONFIG_DFU_MMC
  31 +#endif
  32 +#ifdef CONFIG_SPI_FLASH
  33 +#define CONFIG_DFU_SF
  34 +#endif
  35 +#endif
  36 +
  37 +#endif /* _TEGRA_COMMON_USB_GADGET_H_ */
include/configs/venice2.h
... ... @@ -75,7 +75,7 @@
75 75 #define CONFIG_CMD_NET
76 76 #define CONFIG_CMD_DHCP
77 77  
78   -#include "tegra-common-ums.h"
  78 +#include "tegra-common-usb-gadget.h"
79 79 #include "tegra-common-post.h"
80 80  
81 81 #endif /* __CONFIG_H */