r1151 - trunk/src/target/u-boot/patches
werner at sita.openmoko.org
werner at sita.openmoko.org
Tue Feb 27 21:15:05 CET 2007
Author: werner
Date: 2007-02-27 21:15:03 +0100 (Tue, 27 Feb 2007)
New Revision: 1151
Modified:
trunk/src/target/u-boot/patches/uboot-dfu.patch
Log:
drivers/usbdfu.c (get_partition_nand): mtdparts_init indicates failure with
non-zero return code, not just negative
drivers/usbdfu.c (get_partition_nand): check that "devices" is non-empty before
using its first element
Modified: trunk/src/target/u-boot/patches/uboot-dfu.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-dfu.patch 2007-02-27 19:32:39 UTC (rev 1150)
+++ trunk/src/target/u-boot/patches/uboot-dfu.patch 2007-02-27 20:15:03 UTC (rev 1151)
@@ -1,7 +1,7 @@
Index: u-boot/drivers/usbdcore_ep0.c
===================================================================
---- u-boot.orig/drivers/usbdcore_ep0.c 2007-02-27 00:38:10.000000000 +0100
-+++ u-boot/drivers/usbdcore_ep0.c 2007-02-27 00:38:11.000000000 +0100
+--- u-boot.orig/drivers/usbdcore_ep0.c
++++ u-boot/drivers/usbdcore_ep0.c
@@ -42,10 +42,15 @@
*/
@@ -18,7 +18,7 @@
#if 0
#define dbg_ep0(lvl,fmt,args...) serial_printf("[%s] %s:%d: "fmt"\n",__FILE__,__FUNCTION__,__LINE__,##args)
#else
-@@ -213,7 +218,7 @@
+@@ -213,7 +218,7 @@ static int ep0_get_descriptor (struct us
urb->buffer = device_descriptor;
urb->actual_length = MIN(sizeof(*device_descriptor), max);
}
@@ -27,7 +27,7 @@
break;
case USB_DESCRIPTOR_TYPE_CONFIGURATION:
-@@ -267,7 +272,24 @@
+@@ -267,7 +272,24 @@ static int ep0_get_descriptor (struct us
return -1;
case USB_DESCRIPTOR_TYPE_ENDPOINT:
return -1;
@@ -52,7 +52,7 @@
{
return -1; /* unsupported at this time */
#if 0
-@@ -294,6 +316,7 @@
+@@ -294,6 +316,7 @@ static int ep0_get_descriptor (struct us
max);
#endif
}
@@ -60,7 +60,7 @@
break;
case USB_DESCRIPTOR_TYPE_REPORT:
{
-@@ -388,6 +411,24 @@
+@@ -388,6 +411,24 @@ int ep0_recv_setup (struct urb *urb)
le16_to_cpu (request->wLength),
USBD_DEVICE_REQUESTS (request->bRequest));
@@ -85,7 +85,7 @@
/* handle USB Standard Request (c.f. USB Spec table 9-2) */
if ((request->bmRequestType & USB_REQ_TYPE_MASK) != 0) {
if (device->device_state <= STATE_CONFIGURED)
-@@ -570,7 +611,8 @@
+@@ -570,7 +611,8 @@ int ep0_recv_setup (struct urb *urb)
device->interface = le16_to_cpu (request->wIndex);
device->alternate = le16_to_cpu (request->wValue);
/*dbg_ep0(2, "set interface: %d alternate: %d", device->interface, device->alternate); */
@@ -97,9 +97,9 @@
case USB_REQ_GET_STATUS:
Index: u-boot/drivers/usbdfu.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/drivers/usbdfu.c 2007-02-27 00:38:11.000000000 +0100
-@@ -0,0 +1,995 @@
+--- /dev/null
++++ u-boot/drivers/usbdfu.c
+@@ -0,0 +1,997 @@
+/*
+ * (C) 2007 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -197,8 +197,10 @@
+ struct list_head *pentry;
+ int i;
+
-+ if (mtdparts_init() < 0)
++ if (mtdparts_init())
+ return NULL;
++ if (list_empty(&devices))
++ return NULL;
+
+ dev = list_entry(devices.next, struct mtd_device, link);
+ i = 0;
@@ -1097,9 +1099,9 @@
+#endif /* CONFIG_USBD_DFU */
Index: u-boot/drivers/Makefile
===================================================================
---- u-boot.orig/drivers/Makefile 2007-02-27 00:38:10.000000000 +0100
-+++ u-boot/drivers/Makefile 2007-02-27 00:38:11.000000000 +0100
-@@ -46,7 +46,7 @@
+--- u-boot.orig/drivers/Makefile
++++ u-boot/drivers/Makefile
+@@ -46,7 +46,7 @@ COBJS = 3c589.o 5701rls.o ali512x.o atme
sl811_usb.o sm501.o smc91111.o smiLynxEM.o \
status_led.o sym53c8xx.o systemace.o ahci.o \
ti_pci1410a.o tigon3.o tsec.o \
@@ -1110,8 +1112,8 @@
pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o \
Index: u-boot/drivers/usbdcore.c
===================================================================
---- u-boot.orig/drivers/usbdcore.c 2007-02-27 00:37:59.000000000 +0100
-+++ u-boot/drivers/usbdcore.c 2007-02-27 00:38:11.000000000 +0100
+--- u-boot.orig/drivers/usbdcore.c
++++ u-boot/drivers/usbdcore.c
@@ -31,6 +31,7 @@
#include <malloc.h>
@@ -1120,7 +1122,7 @@
#define MAX_INTERFACES 2
-@@ -212,6 +213,10 @@
+@@ -212,6 +213,10 @@ struct usb_alternate_instance *usbd_devi
*/
struct usb_device_descriptor *usbd_device_device_descriptor (struct usb_device_instance *device, int port)
{
@@ -1131,7 +1133,7 @@
return (device->device_descriptor);
}
-@@ -232,6 +237,10 @@
+@@ -232,6 +237,10 @@ struct usb_configuration_descriptor *usb
if (!(configuration_instance = usbd_device_configuration_instance (device, port, configuration))) {
return NULL;
}
@@ -1142,7 +1144,7 @@
return (configuration_instance->configuration_descriptor);
}
-@@ -253,6 +262,13 @@
+@@ -253,6 +262,13 @@ struct usb_interface_descriptor *usbd_de
if (!(interface_instance = usbd_device_interface_instance (device, port, configuration, interface))) {
return NULL;
}
@@ -1156,7 +1158,7 @@
if ((alternate < 0) || (alternate >= interface_instance->alternates)) {
return NULL;
}
-@@ -681,4 +697,7 @@
+@@ -681,4 +697,7 @@ void usbd_device_event_irq (struct usb_d
/* usbdbg("calling device->event"); */
device->event(device, event, data);
}
@@ -1166,8 +1168,8 @@
}
Index: u-boot/drivers/usbtty.c
===================================================================
---- u-boot.orig/drivers/usbtty.c 2007-02-27 00:38:10.000000000 +0100
-+++ u-boot/drivers/usbtty.c 2007-02-27 00:38:11.000000000 +0100
+--- u-boot.orig/drivers/usbtty.c
++++ u-boot/drivers/usbtty.c
@@ -31,6 +31,8 @@
#include "usbtty.h"
#include "usb_cdc_acm.h"
@@ -1177,7 +1179,7 @@
#include <config.h> /* If defined, override Linux identifiers with
* vendor specific ones */
-@@ -118,7 +120,7 @@
+@@ -118,7 +120,7 @@ extern struct usb_string_descriptor **us
static unsigned short rx_endpoint = 0;
static unsigned short tx_endpoint = 0;
static unsigned short interface_count = 0;
@@ -1186,7 +1188,7 @@
/* USB Descriptor Strings */
static u8 wstrLang[4] = {4,USB_DT_STRING,0x9,0x4};
-@@ -169,6 +171,10 @@
+@@ -169,6 +171,10 @@ struct acm_config_desc {
struct usb_interface_descriptor data_class_interface;
struct usb_endpoint_descriptor
data_endpoints[NUM_ENDPOINTS-1] __attribute__((packed));
@@ -1197,7 +1199,7 @@
} __attribute__((packed));
static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = {
-@@ -179,7 +185,11 @@
+@@ -179,7 +185,11 @@ static struct acm_config_desc acm_config
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength =
cpu_to_le16(sizeof(struct acm_config_desc)),
@@ -1209,7 +1211,7 @@
.bConfigurationValue = 1,
.iConfiguration = STR_CONFIG,
.bmAttributes =
-@@ -278,6 +288,11 @@
+@@ -278,6 +288,11 @@ static struct acm_config_desc acm_config
.bInterval = 0xFF,
},
},
@@ -1221,7 +1223,7 @@
},
};
-@@ -390,7 +405,7 @@
+@@ -390,7 +405,7 @@ static int fill_buffer (circbuf_t * buf)
void usbtty_poll (void);
/* utility function for converting char* to wide string used by USB */
@@ -1230,7 +1232,7 @@
{
int i;
for (i = 0; i < strlen (str) && str[i]; i++){
-@@ -652,6 +667,9 @@
+@@ -652,6 +667,9 @@ static void usbtty_init_instances (void)
device_instance->bus = bus_instance;
device_instance->configurations = NUM_CONFIGS;
device_instance->configuration_instance_array = config_instance;
@@ -1242,8 +1244,8 @@
memset (bus_instance, 0, sizeof (struct usb_bus_instance));
Index: u-boot/include/configs/neo1973.h
===================================================================
---- u-boot.orig/include/configs/neo1973.h 2007-02-27 00:38:11.000000000 +0100
-+++ u-boot/include/configs/neo1973.h 2007-02-27 00:38:11.000000000 +0100
+--- u-boot.orig/include/configs/neo1973.h
++++ u-boot/include/configs/neo1973.h
@@ -165,7 +165,7 @@
*/
#define CONFIG_STACKSIZE (128*1024) /* regular stack */
@@ -1266,8 +1268,8 @@
* Physical Memory Map
Index: u-boot/include/usb_dfu.h
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/include/usb_dfu.h 2007-02-27 00:39:48.000000000 +0100
+--- /dev/null
++++ u-boot/include/usb_dfu.h
@@ -0,0 +1,97 @@
+#ifndef _DFU_H
+#define _DFU_H
@@ -1368,8 +1370,8 @@
+#endif /* _DFU_H */
Index: u-boot/include/usb_dfu_descriptors.h
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/include/usb_dfu_descriptors.h 2007-02-27 00:38:11.000000000 +0100
+--- /dev/null
++++ u-boot/include/usb_dfu_descriptors.h
@@ -0,0 +1,94 @@
+#ifndef _USB_DFU_H
+#define _USB_DFU_H
@@ -1467,8 +1469,8 @@
+#endif /* _USB_DFU_H */
Index: u-boot/include/usbdcore.h
===================================================================
---- u-boot.orig/include/usbdcore.h 2007-02-27 00:38:10.000000000 +0100
-+++ u-boot/include/usbdcore.h 2007-02-27 00:38:11.000000000 +0100
+--- u-boot.orig/include/usbdcore.h
++++ u-boot/include/usbdcore.h
@@ -33,6 +33,7 @@
#include <common.h>
@@ -1477,7 +1479,7 @@
#define MAX_URBS_QUEUED 5
-@@ -475,7 +476,11 @@
+@@ -475,7 +476,11 @@ typedef struct urb_link {
* function driver to inform it that data has arrived.
*/
@@ -1489,7 +1491,7 @@
struct urb {
struct usb_endpoint_instance *endpoint;
-@@ -603,6 +608,12 @@
+@@ -603,6 +608,12 @@ struct usb_device_instance {
unsigned long usbd_rxtx_timestamp;
unsigned long usbd_last_rxtx_timestamp;
@@ -1502,7 +1504,7 @@
};
/* Bus Interface configuration structure
-@@ -632,6 +643,8 @@
+@@ -632,6 +643,8 @@ extern char *usbd_device_status[];
extern char *usbd_device_requests[];
extern char *usbd_device_descriptors[];
@@ -1513,8 +1515,8 @@
urb_link *first_urb_link (urb_link * hd);
Index: u-boot/drivers/usbtty.h
===================================================================
---- u-boot.orig/drivers/usbtty.h 2007-02-27 00:38:10.000000000 +0100
-+++ u-boot/drivers/usbtty.h 2007-02-27 00:38:11.000000000 +0100
+--- u-boot.orig/drivers/usbtty.h
++++ u-boot/drivers/usbtty.h
@@ -71,4 +71,10 @@
#define STR_CTRL_INTERFACE 0x06
#define STR_COUNT 0x07
More information about the commitlog
mailing list