Skip to contentSkip to conversation

DFU initial implementation

PATCH New Andrzej Pietrasiewicz 6 participants 22 messages Nov 9, 2011 – Apr 24, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover DFU initial implementation

Dear All,

This is a quick-and-dirty proof-of-concept for splitting the dfu into core dfu gadget, generic parts of dfu backend, dfu command and target-specific implementation for Goni.

This patch definitely needs some coding style cleanups.

Also, the place for storing generic parts of dfu was chosen somewhat arbitrary and can be changed if a better alternative is found.

The original idea of the flash_entity was to equip it with a void * to a context structure, which is not interpreted by the dfu gadget but passed to the dfu backend and understood there. I am still hesitating if flash_entity_ctx is generic enough to be generalized, as of now I assumed it is. If it wasn't then less common code could be extracted.

@Stefan: you need the first 3 patches from this series, and then you need to implement your own target-specific parts. In fact, all is expected from the target, is to provide board_dfu_init/cleanup pair and call register_flash_entities.

Andrzej Pietrasiewicz (4):
dfu: protocol initial implementation
dfu: generic backend parts
dfu: command implementation
dfu: target-specific implementation for Goni

 Makefile                    |    1 +
 board/samsung/goni/Makefile |    2 +
 board/samsung/goni/flash.c  |  341 ++++++++++++++++
 board/samsung/goni/flash.h  |   28 ++
 board/samsung/goni/goni.c   |   17 +
 common/Makefile             |    1 +
 common/cmd_dfu.c            |   51 +++
 drivers/usb/dfu/Makefile    |   33 ++
 drivers/usb/dfu/dfu.c       |  109 +++++
 drivers/usb/dfu/fat.c       |   77 ++++
 drivers/usb/dfu/mmc.c       |  124 ++++++
 drivers/usb/gadget/Makefile |    1 +
 drivers/usb/gadget/dfu.c    |  920 +++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/dfu.h    |  171 ++++++++
 include/configs/s5p_goni.h  |    4 +
 include/dfu.h               |   28 ++
 include/dfu_backend.h       |   71 ++++
 include/flash_entity.h      |   39 ++
 include/mbr.h               |   49 +++
 19 files changed, 2067 insertions(+), 0 deletions(-)
 create mode 100644 board/samsung/goni/flash.c
 create mode 100644 board/samsung/goni/flash.h
 create mode 100644 common/cmd_dfu.c
 create mode 100644 drivers/usb/dfu/Makefile
 create mode 100644 drivers/usb/dfu/dfu.c
 create mode 100644 drivers/usb/dfu/fat.c
 create mode 100644 drivers/usb/dfu/mmc.c
 create mode 100644 drivers/usb/gadget/dfu.c
 create mode 100644 drivers/usb/gadget/dfu.h
 create mode 100644 include/dfu.h
 create mode 100644 include/dfu_backend.h
 create mode 100644 include/flash_entity.h
 create mode 100644 include/mbr.h
#1 lore raw

PATCH v2 1/4 dfu: protocol initial implementation

---
 drivers/usb/gadget/Makefile |    1 +
 drivers/usb/gadget/dfu.c    |  920 +++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/dfu.h    |  171 ++++++++
 include/dfu.h               |   28 ++
 include/flash_entity.h      |   39 ++
 5 files changed, 1159 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/dfu.c
 create mode 100644 drivers/usb/gadget/dfu.h
 create mode 100644 include/dfu.h
 create mode 100644 include/flash_entity.h
drivers/usb/gadget/Makefile +1 -0
index cd22bbe..4b173e2 100644
@@ -28,6 +28,7 @@ LIB	:= $(obj)libusb_gadget.o
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
 COBJS-y += epautoconf.o config.o usbstring.o
+COBJS-$(CONFIG_DFU_GADGET) += dfu.o
 COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 endif
 ifdef CONFIG_USB_ETHER
drivers/usb/gadget/dfu.c new file +920 -0

920 lines not on this page · raw message

drivers/usb/gadget/dfu.h new file +171 -0

171 lines not on this page · raw message

include/dfu.h new file +28 -0
new file mode 100644
index 0000000..21b89f2
@@ -0,0 +1,28 @@
+/*
+ * dfu.h - Device Firmware Upgrade
+ *
+ * copyright (c) 2011 samsung electronics
+ * author: andrzej pietrasiewicz <[email protected]>
+ *
+ * this program is free software; you can redistribute it and/or modify
+ * it under the terms of the gnu general public license as published by
+ * the free software foundation; either version 2 of the license, or
+ * (at your option) any later version.
+ *
+ * this program is distributed in the hope that it will be useful,
+ * but without any warranty; without even the implied warranty of
+ * merchantability or fitness for a particular purpose.  see the
+ * gnu general public license for more details.
+ *
+ * you should have received a copy of the gnu general public license
+ * along with this program; if not, write to the free software
+ * foundation, inc., 59 temple place, suite 330, boston, ma  02111-1307  usa
+ */
+
+#ifndef __DFU_H__
+#define __DFU_H__
+
+extern int dfu_init(void);
+extern int dfu_cleanup(void);
+
+#endif
include/flash_entity.h new file +39 -0
new file mode 100644
index 0000000..daa90ee
@@ -0,0 +1,39 @@
+/*
+ * flash_entity.h - flashable area description
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * author: Andrzej Pietrasiewicz <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef FLASH_ENTITY_H_
+#define FLASH_ENTITY_H_
+
+#define FLASH_READ			0
+#define FLASH_WRITE			1
+
+struct flash_entity {
+	char				*name;
+	void				*ctx;
+	int (*prepare)(void *ctx, u8 mode);
+	int (*read_block)(void *ctx, unsigned int n, void *buf);
+	int (*write_block)(void *ctx, unsigned int n, void *buf);
+	int (*finish)(void *ctx, u8 mode);
+};
+
+void register_flash_entities(struct flash_entity *flents, int n);
+
+#endif /* FLASH_ENTITY_H_ */
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v2 2/4 dfu: generic backend parts

In reply to Andrzej Pietrasiewicz
---
 Makefile                 |    1 +
 drivers/usb/dfu/Makefile |   33 ++++++++++++
 drivers/usb/dfu/dfu.c    |  109 ++++++++++++++++++++++++++++++++++++++++
 drivers/usb/dfu/fat.c    |   77 ++++++++++++++++++++++++++++
 drivers/usb/dfu/mmc.c    |  124 ++++++++++++++++++++++++++++++++++++++++++++++
 include/dfu_backend.h    |   71 ++++++++++++++++++++++++++
 include/mbr.h            |   49 ++++++++++++++++++
 7 files changed, 464 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/dfu/Makefile
 create mode 100644 drivers/usb/dfu/dfu.c
 create mode 100644 drivers/usb/dfu/fat.c
 create mode 100644 drivers/usb/dfu/mmc.c
 create mode 100644 include/dfu_backend.h
 create mode 100644 include/mbr.h
Makefile +1 -0
index bd72286..83ea3d0 100644
@@ -283,6 +283,7 @@ LIBS += drivers/usb/gadget/libusb_gadget.o
 LIBS += drivers/usb/host/libusb_host.o
 LIBS += drivers/usb/musb/libusb_musb.o
 LIBS += drivers/usb/phy/libusb_phy.o
+LIBS += drivers/usb/dfu/libusb_dfu.o
 LIBS += drivers/video/libvideo.o
 LIBS += drivers/watchdog/libwatchdog.o
 LIBS += common/libcommon.o
drivers/usb/dfu/Makefile new file +33 -0
new file mode 100644
index 0000000..c2fe049
@@ -0,0 +1,33 @@
+include $(TOPDIR)/config.mk
+
+LIB	:= $(obj)libusb_dfu.o
+
+# new USB gadget layer dependencies
+COBJS-y += dfu.o
+
+ifdef CONFIG_MMC
+COBJS-y += mmc.o
+endif
+
+ifdef CONFIG_CMD_FAT
+COBJS-y += fat.o
+endif
+
+COBJS	:= $(COBJS-y)
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+all:	$(LIB)
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
+
drivers/usb/dfu/dfu.c new file +109 -0

109 lines not on this page · raw message

drivers/usb/dfu/fat.c new file +77 -0

77 lines not on this page · raw message

drivers/usb/dfu/mmc.c new file +124 -0

124 lines not on this page · raw message

include/dfu_backend.h new file +71 -0

71 lines not on this page · raw message

include/mbr.h new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 2/4 dfu: generic backend parts

drivers/usb/dfu/Makefile line 14

Quoted 10 lines · On Wednesday 09 November 2011 04:52:21 Andrzej Pietrasiewicz wrote:
drivers/usb/dfu/Makefile new file +7 -0
 
+ifdef CONFIG_MMC
+COBJS-y += mmc.o
+endif
+
+ifdef CONFIG_CMD_FAT
+COBJS-y += fat.o
+endif

COBJS-$(CONFIG_XXX) += foo.o

drivers/usb/dfu/fat.c line 3

Quoted 6 lines
drivers/usb/dfu/fat.c new file +3 -0
@@ -0,0 +1,77 @@
+#include <common.h>
+#include <fat.h>
+#include <dfu_backend.h>

missing intro comment block

drivers/usb/dfu/fat.c line 9

Quoted 1 line
drivers/usb/dfu/fat.c new file +1 -0
+inline int set_fat_part_num(int pnum)

there seems to be a lot of funcs in this file and others that have misplaced "inline" markings

Quoted 18 lines
include/dfu_backend.h new file +14 -0
 
+extern void board_dfu_init(void);
+extern int board_dfu_cleanup(void);
+extern int usb_gadget_handle_interrupts(void);
+
+extern int read_mmc(void *buf, unsigned int len, unsigned long from);
+extern int write_mmc(void *buf, unsigned int len, unsigned long from);
+
+extern block_dev_desc_t *set_fat_dev(block_dev_desc_t *d);
+extern int set_fat_part_num(int pnum);
+extern const char *set_fat_filename(const char *fn);
+extern int read_fat(void *buf, unsigned int len, unsigned long from);
+extern int write_fat(void *buf, unsigned int len, unsigned long from);
+
+extern int read_mbr(struct mmc *mmc, struct mbr_part_data *pd, int

*extended_lba, int mmc_mbr_dev); +

include/dfu_backend.h line 66

Quoted 4 lines
include/dfu_backend.h new file +4 -0
+extern int read_block(void *ctx, unsigned int n, void *buf);
+extern int write_block(void *ctx, unsigned int n, void *buf);
+extern int generic_prepare(void *ctx, u8 mode);
+extern int generic_finish(void *ctx, u8 mode);

API needs to be namespaced here with like "dfu_" prefixes

include/mbr.h

Quoted 2 lines
include/mbr.h new file +0 -0

file needs protection against multiple inclusion

include/mbr.h line 49

Quoted 5 lines
include/mbr.h new file +5 -0
+void set_mbr_dev(int dev);
+void set_mbr_info(char *ramaddr, unsigned int len, unsigned int reserved);
+void set_mbr_table(unsigned int start_addr, int parts,
+		unsigned int *blocks, unsigned int *part_offset);
+int get_mbr_table(unsigned int *part_offset);

seems like you declare funcs here that aren't actually defined ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120108/d4a5dfd1/attachment.pgp>

#4 lore raw

PATCH v2 2/4 dfu: generic backend parts

Hello Mike,

Quoted 7 lines · Mike Frysinger

-----Original Message-----
From: Mike Frysinger [mailto:vapier at gentoo.org]
Sent: Sunday, January 08, 2012 6:14 AM
To: u-boot at lists.denx.de
Cc: Andrzej Pietrasiewicz; Kyungmin Park; Marek Szyprowski
Subject: Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts

<...>

Quoted 3 lines

COBJS-$(CONFIG_XXX) += foo.o

<...>

Quoted 3 lines

missing intro comment block

<...>

Quoted 4 lines

there seems to be a lot of funcs in this file and others that have misplaced "inline" markings

<...>

Quoted 3 lines

API needs to be namespaced here with like "dfu_" prefixes

<...>

Quoted 3 lines

file needs protection against multiple inclusion

<...>

Quoted 2 lines

seems like you declare funcs here that aren't actually defined ... -mike

Thank you for your review. As far as I remember this patch series was a "quick-and-dirty" attempt at splitting the implementation into parts so that Stefan Shmidt could continue his work with his own dfu backends.

However, Wolfgang Denk was not convinced about introducing dfu support to u-boot the way it was proposed. Are there any new circumstances?

Andrzej

#5 lore raw

PATCH 2/4 dfu: generic backend parts

Quoted 3 lines · On Monday 09 January 2012 02:50:00 Andrzej Pietrasiewicz wrote:

However, Wolfgang Denk was not convinced about introducing dfu support to u-boot the way it was proposed. Are there any new circumstances?

i just had the thread marked unread, so i read it & reviewed for some high level details. that's all.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120109/a80dc8c5/attachment.pgp>

#6 lore raw

PATCH 2/4 dfu: generic backend parts

In reply to Andrzej Pietrasiewicz

Dear Andrzej Pietrasiewicz,

Quoted 5 lines · In message <000601cccea3$4a41f750$dec5e5f0$%[email protected]> you wrote:

Thank you for your review. As far as I remember this patch series was a "quick-and-dirty" attempt at splitting the implementation into parts so that Stefan Shmidt could continue his work with his own dfu backends.

Is there any such work goig on? I haven't seen any updates / fixes for Mike's review comments.

Quoted 3 lines

However, Wolfgang Denk was not convinced about introducing dfu support to u-boot the way it was proposed. Are there any new circumstances?

Indeed I would have liked to see a more general approach, and I still feel it should be possible. But if nobody is picking up this idea, it is probably better to support the feature with the current implemen- tation than not at all.

The review comments need to be addressed, though.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"No one talks peace unless he's ready to back it up with war."
"He talks of peace if it is the only way to live."
	-- Colonel Green and Surak of Vulcan, "The Savage Curtain",
	   stardate 5906.5.
#7 lore raw

PATCH 2/4 dfu: generic backend parts

In reply to Andrzej Pietrasiewicz

Hello.

Quoted 5 lines · Andrzej Pietrasiewicz

Thank you for your review. As far as I remember this patch series was a "quick-and-dirty" attempt at splitting the implementation into parts so that Stefan Shmidt could continue his work with his own dfu backends.

Time run out for me on this project and I'm going to relocate to another country for new job this months. In short I want have time to work on this the next months.

Personally I'm still interested in this and may start working on it when everything else settled down. Can not tell when this is though. If anyone else wants to pick this up and push it forward that would be more then welcome. A small patchset with my current state will follow this mail.

Some words about it. As I don't have hardware which is working with U-boot mainline and provides a UDC driver for the new gadget framework I could not directly test your code. Having a DFU implementation for both the old and the new gadget framework turned out to be more trouble then expected. I split the nand backend part out, but it still needs some fixing and especially testing.

For systems with old gadget framework UDC drivers, like the beagleboard with musb, it might still be wise to use the original version I posted earlier here for reference.

Lets hope someone, or maybe myself in some months, will pick this up and finally bring it into mainline.

regards
Stefan Schmidt

#8 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

---
 drivers/usb/gadget/dfu.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/usb/gadget/dfu.c +10 -1
index 535e194..7aed344 100644
@@ -47,6 +47,10 @@
 #include <malloc.h>
 #include "dfu.h"
 
+#ifndef POLL_TIMEOUT_MILLISECONDS
+#define POLL_TIMEOUT_MILLISECONDS 5
+#endif
+
 static struct flash_entity *flash_ents;
 static int num_flash_ents;
 
@@ -271,9 +275,14 @@ static void handle_getstatus(struct usb_request *req)
 
 	/* send status response */
 	dstat->bStatus = dev->dfu_status;
-	/* FIXME: set dstat->bwPollTimeout */
 	dstat->bState = dev->dfu_state;
 	dstat->iString = 0;
+	/* FIXME: Use real values from flash subsystem here instead a hardcoded
+	 * value */
+	dstat->bwPollTimeout[0] = POLL_TIMEOUT_MILLISECONDS & 0xff;
+	dstat->bwPollTimeout[1] = (POLL_TIMEOUT_MILLISECONDS >> 8) & 0xff;
+	dstat->bwPollTimeout[2] = (POLL_TIMEOUT_MILLISECONDS >> 16) & 0xff;
+	//req->actual = MIN(sizeof(*dstat), max);
 }
 
 static void handle_getstate(struct usb_request *req)
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH 2/3 usb/gadget: Add Device Firmware Upgrade (DFU) support.

A vendor independent standard from the USB forum to upgrade firmware on devices over USB. U-Boot is seen as the device to be upgraded here and exposes the functionality over the USB gadget framework.

---
 drivers/serial/usbtty.c        |   22 +-
 drivers/serial/usbtty.h        |    6 +
 drivers/usb/dfu/nand.c         |  386 +++++++++++++++++++++++++++++
 drivers/usb/gadget/Makefile    |    4 +-
 drivers/usb/gadget/core.c      |   19 ++
 drivers/usb/gadget/dfu.c       |   57 ++++-
 drivers/usb/gadget/dfu_old.c   |  521 ++++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/ep0.c       |   50 +++-
 include/configs/omap3_beagle.h |    3 +
 include/dfu_backend.h          |   16 ++
 include/usb_dfu.h              |   97 ++++++++
 include/usb_dfu_descriptors.h  |   94 ++++++++
 include/usbdevice.h            |   13 +
 13 files changed, 1274 insertions(+), 14 deletions(-)
 create mode 100644 drivers/usb/dfu/nand.c
 create mode 100644 drivers/usb/gadget/dfu_old.c
 create mode 100644 include/usb_dfu.h
 create mode 100644 include/usb_dfu_descriptors.h
drivers/serial/usbtty.c +20 -2
index cffd5a2..b13b497 100644
@@ -22,6 +22,8 @@
  */
 
 #include <common.h>
+#include <usb_dfu_descriptors.h>
+#include <usb_dfu.h>
 #include <config.h>
 #include <circbuf.h>
 #include <stdio_dev.h>
@@ -101,7 +103,7 @@ extern struct usb_string_descriptor **usb_strings;
 static unsigned short rx_endpoint = 0;
 static unsigned short tx_endpoint = 0;
 static unsigned short interface_count = 0;
-static struct usb_string_descriptor *usbtty_string_table[STR_COUNT];
+static struct usb_string_descriptor *usbtty_string_table[NUM_STRINGS];
 
 /* USB Descriptor Strings */
 static u8 wstrLang[4] = {4,USB_DT_STRING,0x9,0x4};
@@ -151,6 +153,10 @@ struct acm_config_desc {
 	/* Slave Interface */
 	struct usb_interface_descriptor data_class_interface;
 	struct usb_endpoint_descriptor data_endpoints[NUM_ENDPOINTS-1];
+#ifdef CONFIG_USBD_DFU
+	struct usb_interface_descriptor uif_dfu;
+	struct usb_dfu_func_descriptor func_dfu;
+#endif
 } __attribute__((packed));
 
 static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = {
@@ -161,7 +167,11 @@ static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = {
 			.bDescriptorType = USB_DT_CONFIG,
 			.wTotalLength =
 				cpu_to_le16(sizeof(struct acm_config_desc)),
+#ifdef CONFIG_USBD_DFU
+			.bNumInterfaces = NUM_ACM_INTERFACES + 1,
+#else
 			.bNumInterfaces = NUM_ACM_INTERFACES,
+#endif
 			.bConfigurationValue = 1,
 			.iConfiguration = STR_CONFIG,
 			.bmAttributes =
@@ -260,6 +270,11 @@ static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = {
 				.bInterval		= 0xFF,
 			},
 		},
+#ifdef CONFIG_USBD_DFU
+		/* Interface 3 */
+		.uif_dfu = DFU_RT_IF_DESC,
+		.func_dfu = DFU_FUNC_DESC,
+#endif
 	},
 };
 
@@ -370,7 +385,7 @@ static int fill_buffer (circbuf_t * buf);
 void usbtty_poll (void);
 
 /* utility function for converting char* to wide string used by USB */
-static void str2wide (char *str, u16 * wide)
+void str2wide (char *str, u16 * wide)
 {
 	int i;
 	for (i = 0; i < strlen (str) && str[i]; i++){
@@ -639,6 +654,9 @@ static void usbtty_init_instances (void)
 	device_instance->bus = bus_instance;
 	device_instance->configurations = NUM_CONFIGS;
 	device_instance->configuration_instance_array = config_instance;
+#ifdef CONFIG_USBD_DFU
+	dfu_init_instance(device_instance);
+#endif
 
 	/* initialize bus instance */
 	memset (bus_instance, 0, sizeof (struct usb_bus_instance));
drivers/serial/usbtty.h +6 -0
index 14961c1..16ae86e 100644
@@ -84,4 +84,10 @@
 #define STR_CTRL_INTERFACE	0x06
 #define STR_COUNT		0x07
 
+#ifdef CONFIG_USBD_DFU
+#define NUM_STRINGS		DFU_STR_COUNT
+#else
+#define NUM_STRINGS		STR_COUNT
+#endif
+
 #endif
drivers/usb/dfu/nand.c new file +386 -0

386 lines not on this page · raw message

drivers/usb/gadget/Makefile +3 -1
index 38af8c4..a97d953 100644
@@ -28,13 +28,15 @@ LIB	:= $(obj)libusb_gadget.o
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_ETHER
 COBJS-y += ether.o epautoconf.o config.o usbstring.o
+COBJS-$(CONFIG_DFU_GADGET) += dfu.o
 COBJS-$(CONFIG_USB_ETH_RNDIS) += rndis.o
 else
-COBJS-$(CONFIG_DFU_GADGET) += dfu.o
 # Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE
 ifdef CONFIG_USB_DEVICE
 COBJS-y += core.o
 COBJS-y += ep0.o
+COBJS-y += dfu_old.o
+COBJS-$(CONFIG_DFU_GADGET) += dfu.o
 COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o
 COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o
 COBJS-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o
drivers/usb/gadget/core.c +19 -0
index 67b6681..e5ee9f6 100644
@@ -31,6 +31,7 @@
 
 #include <malloc.h>
 #include <usbdevice.h>
+#include <usb_dfu.h>
 
 #define MAX_INTERFACES 2
 
@@ -209,6 +210,10 @@ struct usb_alternate_instance *usbd_device_alternate_instance (struct usb_device
  */
 struct usb_device_descriptor *usbd_device_device_descriptor (struct usb_device_instance *device, int port)
 {
+#ifdef CONFIG_USBD_DFU
+	if (device->dfu_state != DFU_STATE_appIDLE)
+		return device->dfu_dev_desc;
+#endif
 	return (device->device_descriptor);
 }
 
@@ -229,6 +234,10 @@ struct usb_configuration_descriptor *usbd_device_configuration_descriptor (struc
 	if (!(configuration_instance = usbd_device_configuration_instance (device, port, configuration))) {
 		return NULL;
 	}
+#ifdef CONFIG_USBD_DFU
+	if (device->dfu_state != DFU_STATE_appIDLE)
+		return (&device->dfu_cfg_desc->ucfg);
+#endif
 	return (configuration_instance->configuration_descriptor);
 }
 
@@ -250,6 +259,13 @@ struct usb_interface_descriptor *usbd_device_interface_descriptor (struct usb_de
 	if (!(interface_instance = usbd_device_interface_instance (device, port, configuration, interface))) {
 		return NULL;
 	}
+#ifdef CONFIG_USBD_DFU
+	if (device->dfu_state != DFU_STATE_appIDLE) {
+		if (alternate < 0 || alternate >= DFU_NUM_ALTERNATES)
+			return NULL;
+		return &device->dfu_cfg_desc->uif[alternate];
+	}
+#endif
 	if ((alternate < 0) || (alternate >= interface_instance->alternates)) {
 		return NULL;
 	}
@@ -680,4 +696,7 @@ void usbd_device_event_irq (struct usb_device_instance *device, usb_device_event
 		/* usbdbg("calling device->event"); */
 		device->event(device, event, data);
 	}
+#ifdef CONFIG_USBD_DFU
+	dfu_event(device, event, data);
+#endif
 }
drivers/usb/gadget/dfu.c +48 -9

176 lines not on this page · raw message

drivers/usb/gadget/dfu_old.c new file +521 -0

521 lines not on this page · raw message

drivers/usb/gadget/ep0.c +48 -2

87 lines not on this page · raw message

include/configs/omap3_beagle.h +3 -0
index 15e40c5..6be4d10 100644
@@ -138,6 +138,9 @@
 #define CONFIG_USB_ETHER_SMSC95XX
 #define CONFIG_USB_ETHER_ASIX
 
+#define CONFIG_DFU_GADGET
+//#define CONFIG_USB_ETHER
+
 
 /* commands to include */
 #include <config_cmd_default.h>
include/dfu_backend.h +16 -0
index 8c608d1..a93f181 100644
@@ -21,6 +21,7 @@
 
 #ifndef __DFU_BACKEND_H__
 #define __DFU_BACKEND_H__
+#include <nand.h>
 
 struct mbr_part_data {
 	unsigned long		offset; /* #sectors from mmc begin */
@@ -43,6 +44,21 @@ struct flash_entity_ctx {
 	erase_op		erase; /* erase op for this medium or NULL */
 	struct flash_entity	*this_entity; /* the containing entity */
 	void			*associated; /* related entity, if any */
+
+
+	nand_info_t *nand;
+	struct part_info *part;
+	unsigned int part_net_size;	/* net size (no bad blocks) of part */
+	nand_erase_options_t erase_opts;
+
+	unsigned char *ptr;	/* pointer to next empty byte in buffer */
+	unsigned int off;	/* offset of current erase page in flash chip */
+
+	/* unless doing an atomic transfer, we use the static buffer below.
+	 * This saves us from having to clean up dynamic allications in the
+	 * various error paths of the code.  Also, it will always work, no
+	 * matter what the memory situation is. */
+	unsigned char _buf[0x20000];	/* FIXME: depends flash page size */
 };
 
 extern void board_dfu_init(void);
include/usb_dfu.h new file +97 -0

97 lines not on this page · raw message

include/usb_dfu_descriptors.h new file +94 -0

94 lines not on this page · raw message

include/usbdevice.h +13 -0
index 4171636..6c2fc27 100644
@@ -33,6 +33,7 @@
 
 #include <common.h>
 #include "usbdescriptors.h"
+#include <usb_dfu_descriptors.h>
 
 
 #define MAX_URBS_QUEUED 5
@@ -467,7 +468,11 @@ typedef struct urb_link {
  * function driver to inform it that data has arrived.
  */
 
+#ifdef CONFIG_USBD_DFU
+#define URB_BUF_SIZE (128+CONFIG_USBD_DFU_XFER_SIZE)
+#else
 #define URB_BUF_SIZE 128 /* in linux we'd malloc this, but in u-boot we prefer static data */
+#endif
 struct urb {
 
 	struct usb_endpoint_instance *endpoint;
@@ -595,6 +600,12 @@ struct usb_device_instance {
 	unsigned long usbd_rxtx_timestamp;
 	unsigned long usbd_last_rxtx_timestamp;
 
+#ifdef CONFIG_USBD_DFU
+	const struct usb_device_descriptor *dfu_dev_desc;
+	const struct _dfu_desc *dfu_cfg_desc;
+	enum dfu_state dfu_state;
+	u_int8_t dfu_status;
+#endif
 };
 
 /* Bus Interface configuration structure
@@ -624,6 +635,8 @@ extern char *usbd_device_status[];
 extern char *usbd_device_requests[];
 extern char *usbd_device_descriptors[];
 
+extern struct usb_string_descriptor **usb_strings;
+
 void urb_link_init (urb_link * ul);
 void urb_detach (struct urb *urb);
 urb_link *first_urb_link (urb_link * hd);
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH 3/3 beagle: Enable DFU support with stub functions for now

In reply to Stefan Schmidt
---
 board/ti/beagle/beagle.c       |   17 +++++++++++++++++
 board/ti/beagle/config.mk      |    4 ++++
 include/configs/omap3_beagle.h |    9 ++++++++-
 3 files changed, 29 insertions(+), 1 deletion(-)
board/ti/beagle/beagle.c +17 -0
index 9482c5e..e904b10 100644
@@ -528,3 +528,20 @@ U_BOOT_CMD(
 	"Return the status of the BeagleBoard USER button",
 	""
 );
+
+void register_flash_areas(void);
+void unregister_flash_areas(void);
+
+void board_dfu_init(void)
+{
+   register_flash_areas();
+}
+
+void board_dfu_cleanup(void)
+{
+   unregister_flash_areas();
+}
+
+void dfu_init(void) {}
+void dfu_cleanup(void){}
+void usb_gadget_handle_interrupts(void){}
board/ti/beagle/config.mk +4 -0
index cf055db..203d920 100644
@@ -31,3 +31,7 @@
 
 # For use with external or internal boots.
 CONFIG_SYS_TEXT_BASE = 0x80008000
+
+CONFIG_USB_DFU_VENDOR=0x1457
+CONFIG_USB_DFU_PRODUCT=0x5119
+CONFIG_USB_DFU_REVISION=0x0230
include/configs/omap3_beagle.h +8 -1
index 6be4d10..08c4699 100644
@@ -139,8 +139,15 @@
 #define CONFIG_USB_ETHER_ASIX
 
 #define CONFIG_DFU_GADGET
+#define CONFIG_CMD_DEVICE_FIRMWARE_UPGRADE
 //#define CONFIG_USB_ETHER
 
+#define CONFIG_USBD_DFU                        1
+#define CONFIG_USBD_DFU_XFER_SIZE      0x1000
+#define CONFIG_USBD_DFU_INTERFACE      2
+
+#define DFU_NUM_ALTERNATES 6
+
 
 /* commands to include */
 #include <config_cmd_default.h>
@@ -341,7 +348,7 @@
  */
 #define CONFIG_STACKSIZE	(128 << 10)	/* regular stack 128 KiB */
 #ifdef CONFIG_USE_IRQ
-#define CONFIG_STACKSIZE_IRQ	(4 << 10)	/* IRQ stack 4 KiB */
+#define CONFIG_STACKSIZE_IRQ	(8 << 10)	/* IRQ stack 8 KiB */
 #define CONFIG_STACKSIZE_FIQ	(4 << 10)	/* FIQ stack 4 KiB */
 #endif
 
Signature · 1 line
1.7.9.5
#11 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

In reply to Stefan Schmidt

Dear Stefan Schmidt,

Nice stuff, can you CC me when it comes to USB stuff, accidentally I became the new maintainer ? ;-)

Quoted 22 lines
---
 drivers/usb/gadget/dfu.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/usb/gadget/dfu.c +4 -0
index 535e194..7aed344 100644
@@ -47,6 +47,10 @@
 #include <malloc.h>
 #include "dfu.h"
 
+#ifndef POLL_TIMEOUT_MILLISECONDS
+#define POLL_TIMEOUT_MILLISECONDS 5
+#endif
+
 static struct flash_entity *flash_ents;
 static int num_flash_ents;
 
@@ -271,9 +275,14 @@ static void handle_getstatus(struct usb_request *req)
 
 	/* send status response */

drivers/usb/gadget/dfu.c static void handle_getstatus(struct usb_request *req) · line 285

Quoted 10 lines
drivers/usb/gadget/dfu.c +6 -1
 	dstat->bStatus = dev->dfu_status;
-	/* FIXME: set dstat->bwPollTimeout */
 	dstat->bState = dev->dfu_state;
 	dstat->iString = 0;
+	/* FIXME: Use real values from flash subsystem here instead a hardcoded
+	 * value */
+	dstat->bwPollTimeout[0] = POLL_TIMEOUT_MILLISECONDS & 0xff;
+	dstat->bwPollTimeout[1] = (POLL_TIMEOUT_MILLISECONDS >> 8) & 0xff;
+	dstat->bwPollTimeout[2] = (POLL_TIMEOUT_MILLISECONDS >> 16) & 0xff;
+	//req->actual = MIN(sizeof(*dstat), max);

What do you expect from me to tell you about this patch? Or do you expect someone else to comment on this?

drivers/usb/gadget/dfu.c static void handle_getstatus(struct usb_request *req) · line 288

Quoted 3 lines
drivers/usb/gadget/dfu.c +0 -0
 }
 
 static void handle_getstate(struct usb_request *req)

Best regards,
Marek Vasut

#12 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

Quoted 2 lines · On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:

What do you expect from me to tell you about this patch? Or do you expect someone else to comment on this?

he mentioned in the summary of the series. he's run out of time, so he's dumping his WIP state in case someone else picks it up.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120405/bf7e7d99/attachment.pgp>

#13 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

Dear Mike Frysinger,

Quoted 6 lines · On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
Quoted 2 lines

What do you expect from me to tell you about this patch? Or do you expect someone else to comment on this?

he mentioned in the summary of the series. he's run out of time, so he's dumping his WIP state in case someone else picks it up.

"Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this summary? I see, didn't notice it, but just read it.

Stefan, thanks for your work, I hope you'll be back eventually :)

Quoted 1 line

-mike

Best regards,
Marek Vasut

#14 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

Hello.

Quoted 5 lines · Marek Vasut
Quoted 5 lines · On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
Quoted 2 lines

What do you expect from me to tell you about this patch? Or do you expect someone else to comment on this?

Quoted 7 lines
Quoted 2 lines

he mentioned in the summary of the series. he's run out of time, so he's dumping his WIP state in case someone else picks it up.

"Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this summary? I see, didn't notice it, but just read it.

Stefan, thanks for your work, I hope you'll be back eventually :)

Time will tell. I still think its a worthwhile feature. I just need to find some time, motivation and hardware to work on it again. Will take at leats a couple of months though before I would start anything. Just relocated to another country and still in need for a flat to rent and sort out life and work. :)

regards
Stefan Schmidt

#15 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

Dear Stefan Schmidt,

Quoted 13 lines

Hello.

Quoted 10 lines · Marek Vasut
Quoted 6 lines · On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
Quoted 2 lines

What do you expect from me to tell you about this patch? Or do you expect someone else to comment on this?

he mentioned in the summary of the series. he's run out of time, so he's dumping his WIP state in case someone else picks it up.

"Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this summary? I see, didn't notice it, but just read it.

Quoted 7 lines
Quoted 1 line

Stefan, thanks for your work, I hope you'll be back eventually :)

Time will tell. I still think its a worthwhile feature. I just need to find some time, motivation and hardware to work on it again. Will take at leats a couple of months though before I would start anything. Just relocated to another country and still in need for a flat to rent and sort out life and work. :)

Good luck on that :-)

Quoted 2 lines

regards
Stefan Schmidt

Best regards,
Marek Vasut

#16 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

Dear Marek, Stefan

Quoted 18 lines

Dear Stefan Schmidt,

Quoted 16 lines

Hello.

Quoted 12 lines · Marek Vasut
Quoted 7 lines · On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
Quoted 2 lines

What do you expect from me to tell you about this patch? Or do you expect someone else to comment on this?

he mentioned in the summary of the series. he's run out of time, so he's dumping his WIP state in case someone else picks it up.

"Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this summary? I see, didn't notice it, but just read it.

Stefan, thanks for your work, I hope you'll be back eventually :)

Quoted 8 lines
Quoted 5 lines

Time will tell. I still think its a worthwhile feature. I just need to find some time, motivation and hardware to work on it again. Will take at leats a couple of months though before I would start anything. Just relocated to another country and still in need for a flat to rent and sort out life and work. :)

Good luck on that :-)

I'm working on the composite gadget (as Marek know already :-)). On top of the g_dnl USB composite download driver it is possible to lay down the DFU function.

Actualy we (I mean Andrzej Pietrasiewicz and me), have managed to provide some proof-of-concept DFU code running with g_dnl driver (both DFU + THOR). Unfortunately this code is not yet "finished" and THOR protocol support has higher priority now.

When we post DFU patches we will add you guys on the Cc.

Signature · 6 lines
Best regards,

Lukasz Majewski

Samsung Poland R&D Center
Platform Group
#17 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

Dear Lukasz Majewski,

Quoted 32 lines

Dear Marek, Stefan

Quoted 18 lines

Dear Stefan Schmidt,

Quoted 16 lines

Hello.

Quoted 12 lines · Marek Vasut
Quoted 7 lines · On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
Quoted 2 lines

What do you expect from me to tell you about this patch? Or do you expect someone else to comment on this?

he mentioned in the summary of the series. he's run out of time, so he's dumping his WIP state in case someone else picks it up.

"Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this summary? I see, didn't notice it, but just read it.

Stefan, thanks for your work, I hope you'll be back eventually :)

Quoted 7 lines
Quoted 5 lines

Time will tell. I still think its a worthwhile feature. I just need to find some time, motivation and hardware to work on it again. Will take at leats a couple of months though before I would start anything. Just relocated to another country and still in need for a flat to rent and sort out life and work. :)

Good luck on that :-)

I'm working on the composite gadget (as Marek know already :-)). On top of the g_dnl USB composite download driver it is possible to lay down the DFU function.

Quoted 6 lines

Actualy we (I mean Andrzej Pietrasiewicz and me), have managed to provide some proof-of-concept DFU code running with g_dnl driver (both DFU + THOR). Unfortunately this code is not yet "finished" and THOR protocol support has higher priority now.

When we post DFU patches we will add you guys on the Cc.

I hope to review your stuff ASAP

Best regards,
Marek Vasut

#18 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

In reply to Lukasz Majewski

Hello.

Quoted 21 lines · Lukasz Majewski
Quoted 21 lines
Quoted 20 lines · Marek Vasut
Quoted 4 lines
Quoted 4 lines · On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
Quoted 2 lines

What do you expect from me to tell you about this patch? Or do you expect someone else to comment on this?

Quoted 8 lines
Quoted 3 lines

he mentioned in the summary of the series. he's run out of time, so he's dumping his WIP state in case someone else picks it up.

"Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this summary? I see, didn't notice it, but just read it.

Stefan, thanks for your work, I hope you'll be back eventually :)

Time will tell. I still think its a worthwhile feature. I just need to find some time, motivation and hardware to work on it again. Will take at leats a couple of months though before I would start anything. Just relocated to another country and still in need for a flat to rent and sort out life and work. :)

Quoted 6 lines
Quoted 2 lines

Good luck on that :-)

I'm working on the composite gadget (as Marek know already :-)). On top of the g_dnl USB composite download driver it is possible to lay down the DFU function.

Yeah, I have seen this patches. That is all fine with me. I'm not bound to my patches at all. Having DFU in u-boot mainline is the goal. :)

One of the problems I had was that I did not have hardware with a UDC driver that is compatible with new gadget layer from the kernel ported to u-boot. I agree that its the way to go to have composite and more but it is quite hard to test against when only some drivers are supporting it. The Beagleboard I used for most of the tests was still using the musb driver with some glue and does not support it for example.

That should not be a problem on your side as all Samsung UDCs are written for the new gadget framework anyway.

Quoted 6 lines

Actualy we (I mean Andrzej Pietrasiewicz and me), have managed to provide some proof-of-concept DFU code running with g_dnl driver (both DFU + THOR). Unfortunately this code is not yet "finished" and THOR protocol support has higher priority now.

When we post DFU patches we will add you guys on the Cc.

Thanks.

regards
Stefan Schmidt

#19 lore raw

PATCH 1/3 dfu: Add default value for bwPollTimeout

In reply to Marek Vasut

Hello.

Quoted 3 lines · Marek Vasut

Nice stuff, can you CC me when it comes to USB stuff, accidentally I became the new maintainer ? ;-)

Yeah, forgot about this while I was trying to get at leats my latest state out of the door. If I will send an updated version I will put you in CC.

regards
Stefan Schmidt

#20 lore raw

PATCH v2 3/4 dfu: command implementation

In reply to Andrzej Pietrasiewicz
---
 common/Makefile  |    1 +
 common/cmd_dfu.c |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_dfu.c
common/Makefile +1 -0
index 1b672ad..3322b97 100644
@@ -162,6 +162,7 @@ COBJS-y += cmd_usb.o
 COBJS-y += usb.o
 COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
+COBJS-$(CONFIG_CMD_DEVICE_FIRMWARE_UPGRADE) += cmd_dfu.o
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
 
common/cmd_dfu.c new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#21 lore raw

PATCH v2 4/4 dfu: target-specific implementation for Goni

In reply to Andrzej Pietrasiewicz
---
 board/samsung/goni/Makefile |    2 +
 board/samsung/goni/flash.c  |  341 +++++++++++++++++++++++++++++++++++++++++++
 board/samsung/goni/flash.h  |   28 ++++
 board/samsung/goni/goni.c   |   17 ++
 include/configs/s5p_goni.h  |    4 +
 5 files changed, 392 insertions(+), 0 deletions(-)
 create mode 100644 board/samsung/goni/flash.c
 create mode 100644 board/samsung/goni/flash.h
board/samsung/goni/Makefile +2 -0
index ecde7a7..3f13cb8 100644
@@ -31,6 +31,8 @@ LIB	= $(obj)lib$(BOARD).o
 COBJS-y	:= goni.o onenand.o
 SOBJS	:= lowlevel_init.o
 
+COBJS-$(CONFIG_DFU_FOR_BOARD) += flash.o
+
 SRCS    := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS-y))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
board/samsung/goni/flash.c new file +341 -0

341 lines not on this page · raw message

board/samsung/goni/flash.h new file +28 -0
new file mode 100644
index 0000000..ffe4d6d
@@ -0,0 +1,28 @@
+/*
+ * flash.h -- board flashing routines interface
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * author: Andrzej Pietrasiewicz <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef FLASH_GONI_H_
+#define FLASH_GONI_H_
+
+void register_flash_areas(void);
+void unregister_flash_areas(void);
+
+#endif
board/samsung/goni/goni.c +17 -0
index c4fc3e9..7e693be 100644
@@ -29,6 +29,9 @@
 #include <asm/arch/hs_otg.h>
 #include <asm/arch/cpu.h>
 #include <max8998_pmic.h>
+
+#include "flash.h"
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static struct s5pc110_gpio *s5pc110_gpio;
@@ -144,4 +147,18 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
 	.regs_phy = S5PC110_PHY_BASE,
 	.regs_otg = S5PC110_OTG_BASE,
 };
+
+#ifdef CONFIG_DFU_FOR_BOARD
+void board_dfu_init(void)
+{
+	register_flash_areas();
+	s3c_udc_probe(&s5pc110_otg_data);
+}
+
+void board_dfu_cleanup(void)
+{
+	unregister_flash_areas();
+}
+#endif
+
 #endif
include/configs/s5p_goni.h +4 -0
index df97802..3881f92 100644
@@ -86,6 +86,8 @@
 #define CONFIG_CMD_ONENAND
 #define CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MMC
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_DEVICE_FIRMWARE_UPGRADE
 
 #define CONFIG_BOOTDELAY		1
 #define CONFIG_ZERO_BOOTDELAY_CHECK
@@ -241,4 +243,6 @@
 #define CONFIG_USB_GADGET_S3C_UDC_OTG	1
 #define CONFIG_USB_GADGET_DUALSPEED	1
 
+#define CONFIG_DFU_GADGET
+#define CONFIG_DFU_FOR_BOARD
 #endif	/* __CONFIG_H */
Signature · 1 line
1.7.0.4