Changeset 1284
- Timestamp:
- 03/08/07 23:27:48 (6 years ago)
- Location:
- trunk/src/target/u-boot/patches
- Files:
-
- 2 edited
-
boot-menu.patch (modified) (5 diffs)
-
uboot-dfu.patch (modified) (32 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/u-boot/patches/boot-menu.patch
r1283 r1284 23 23 --- /dev/null 24 24 +++ u-boot/board/neo1973/bootmenu.c 25 @@ -0,0 +1,3 35 @@25 @@ -0,0 +1,365 @@ 26 26 +/* 27 27 + * bootmenu.c - Boot menu … … 51 51 +#include <console.h> 52 52 +#include <environment.h> 53 +#include <environment.h> 54 +#include <asm/atomic.h> 55 + 56 +#ifdef CONFIG_USBD_DFU 57 +#include "usbdcore.h" 58 +#include "usb_dfu.h" 59 +#endif 53 60 + 54 61 +#include "neo1973.h" … … 258 265 + 259 266 + 267 +static int system_idle(void) 268 +{ 269 +#ifdef CONFIG_USBD_DFU 270 + if (system_dfu_state) 271 + return *system_dfu_state == DFU_STATE_appIDLE; 272 +#endif 273 + return 1; 274 +} 275 + 276 + 277 +static void poweroff_if_idle(void) 278 +{ 279 + unsigned long flags; 280 + 281 + local_irq_save(flags); 282 + if (system_idle()) 283 + neo1973_poweroff(); 284 + local_irq_restore(flags); 285 +} 286 + 287 + 260 288 +static void do_option(int option) 261 289 +{ … … 291 319 + } 292 320 + if (!option) 293 + neo1973_poweroff();321 + poweroff_if_idle(); 294 322 + init_bootmenu(); 295 323 +} … … 323 351 + on = tmp; 324 352 + if (neo1973_new_second()) 325 + if (++seconds > boot_menu_timeout) 326 + neo1973_poweroff(); 353 + if (++seconds > boot_menu_timeout) { 354 + poweroff_if_idle(); 355 + seconds = 0; 356 + } 327 357 +} 328 358 + -
trunk/src/target/u-boot/patches/uboot-dfu.patch
r1155 r1284 1 1 Index: u-boot/drivers/usbdcore_ep0.c 2 2 =================================================================== 3 --- u-boot.orig/drivers/usbdcore_ep0.c 2007-02-28 03:51:25.000000000 +01004 +++ u-boot/drivers/usbdcore_ep0.c 2007-02-28 03:51:25.000000000 +01003 --- u-boot.orig/drivers/usbdcore_ep0.c 4 +++ u-boot/drivers/usbdcore_ep0.c 5 5 @@ -42,10 +42,15 @@ 6 6 */ … … 19 19 #define dbg_ep0(lvl,fmt,args...) serial_printf("[%s] %s:%d: "fmt"\n",__FILE__,__FUNCTION__,__LINE__,##args) 20 20 #else 21 @@ -213,7 +218,7 @@ 21 @@ -213,7 +218,7 @@ static int ep0_get_descriptor (struct us 22 22 urb->buffer = device_descriptor; 23 23 urb->actual_length = MIN(sizeof(*device_descriptor), max); … … 28 28 29 29 case USB_DESCRIPTOR_TYPE_CONFIGURATION: 30 @@ -267,7 +272,24 @@ 30 @@ -267,7 +272,24 @@ static int ep0_get_descriptor (struct us 31 31 return -1; 32 32 case USB_DESCRIPTOR_TYPE_ENDPOINT: … … 53 53 return -1; /* unsupported at this time */ 54 54 #if 0 55 @@ -294,6 +316,7 @@ 55 @@ -294,6 +316,7 @@ static int ep0_get_descriptor (struct us 56 56 max); 57 57 #endif … … 61 61 case USB_DESCRIPTOR_TYPE_REPORT: 62 62 { 63 @@ -388,6 +411,24 @@ 63 @@ -388,6 +411,24 @@ int ep0_recv_setup (struct urb *urb) 64 64 le16_to_cpu (request->wLength), 65 65 USBD_DEVICE_REQUESTS (request->bRequest)); … … 86 86 if ((request->bmRequestType & USB_REQ_TYPE_MASK) != 0) { 87 87 if (device->device_state <= STATE_CONFIGURED) 88 @@ -570,7 +611,8 @@ 88 @@ -570,7 +611,8 @@ int ep0_recv_setup (struct urb *urb) 89 89 device->interface = le16_to_cpu (request->wIndex); 90 90 device->alternate = le16_to_cpu (request->wValue); … … 98 98 Index: u-boot/drivers/usbdfu.c 99 99 =================================================================== 100 --- /dev/null 1970-01-01 00:00:00.000000000 +0000101 +++ u-boot/drivers/usbdfu.c 2007-02-28 03:51:58.000000000 +0100102 @@ -0,0 +1,100 0@@100 --- /dev/null 101 +++ u-boot/drivers/usbdfu.c 102 @@ -0,0 +1,1007 @@ 103 103 +/* 104 104 + * (C) 2007 by OpenMoko, Inc. … … 168 168 +#define RET_ZLP 1 169 169 +#define RET_STALL 2 170 + 171 +volatile enum dfu_state *system_dfu_state; /* for 3rd parties */ 172 + 170 173 + 171 174 +struct dnload_state { … … 1025 1028 + dev->dfu_status = DFU_STATUS_OK; 1026 1029 + 1030 + if (system_dfu_state) 1031 + printf("SURPRISE: system_dfu_state is already set\n"); 1032 + system_dfu_state = &dev->dfu_state; 1033 + 1027 1034 + dfu_init_strings(dev); 1028 1035 + … … 1103 1110 Index: u-boot/drivers/Makefile 1104 1111 =================================================================== 1105 --- u-boot.orig/drivers/Makefile 2007-02-28 03:51:25.000000000 +01001106 +++ u-boot/drivers/Makefile 2007-02-28 03:51:25.000000000 +01001107 @@ -46,7 +46,7 @@ 1112 --- u-boot.orig/drivers/Makefile 1113 +++ u-boot/drivers/Makefile 1114 @@ -46,7 +46,7 @@ COBJS = 3c589.o 5701rls.o ali512x.o atme 1108 1115 sl811_usb.o sm501.o smc91111.o smiLynxEM.o \ 1109 1116 status_led.o sym53c8xx.o systemace.o ahci.o \ … … 1116 1123 Index: u-boot/drivers/usbdcore.c 1117 1124 =================================================================== 1118 --- u-boot.orig/drivers/usbdcore.c 2007-02-28 03:47:38.000000000 +01001119 +++ u-boot/drivers/usbdcore.c 2007-02-28 03:51:25.000000000 +01001125 --- u-boot.orig/drivers/usbdcore.c 1126 +++ u-boot/drivers/usbdcore.c 1120 1127 @@ -31,6 +31,7 @@ 1121 1128 … … 1126 1133 #define MAX_INTERFACES 2 1127 1134 1128 @@ -212,6 +213,10 @@ 1135 @@ -212,6 +213,10 @@ struct usb_alternate_instance *usbd_devi 1129 1136 */ 1130 1137 struct usb_device_descriptor *usbd_device_device_descriptor (struct usb_device_instance *device, int port) … … 1137 1144 } 1138 1145 1139 @@ -232,6 +237,10 @@ 1146 @@ -232,6 +237,10 @@ struct usb_configuration_descriptor *usb 1140 1147 if (!(configuration_instance = usbd_device_configuration_instance (device, port, configuration))) { 1141 1148 return NULL; … … 1148 1155 } 1149 1156 1150 @@ -253,6 +262,13 @@ 1157 @@ -253,6 +262,13 @@ struct usb_interface_descriptor *usbd_de 1151 1158 if (!(interface_instance = usbd_device_interface_instance (device, port, configuration, interface))) { 1152 1159 return NULL; … … 1162 1169 return NULL; 1163 1170 } 1164 @@ -681,4 +697,7 @@ 1171 @@ -681,4 +697,7 @@ void usbd_device_event_irq (struct usb_d 1165 1172 /* usbdbg("calling device->event"); */ 1166 1173 device->event(device, event, data); … … 1172 1179 Index: u-boot/drivers/usbtty.c 1173 1180 =================================================================== 1174 --- u-boot.orig/drivers/usbtty.c 2007-02-28 03:51:24.000000000 +01001175 +++ u-boot/drivers/usbtty.c 2007-02-28 03:51:25.000000000 +01001181 --- u-boot.orig/drivers/usbtty.c 1182 +++ u-boot/drivers/usbtty.c 1176 1183 @@ -31,6 +31,8 @@ 1177 1184 #include "usbtty.h" … … 1183 1190 * vendor specific ones */ 1184 1191 1185 @@ -118,7 +120,7 @@ 1192 @@ -118,7 +120,7 @@ extern struct usb_string_descriptor **us 1186 1193 static unsigned short rx_endpoint = 0; 1187 1194 static unsigned short tx_endpoint = 0; … … 1192 1199 /* USB Descriptor Strings */ 1193 1200 static u8 wstrLang[4] = {4,USB_DT_STRING,0x9,0x4}; 1194 @@ -169,6 +171,10 @@ 1201 @@ -169,6 +171,10 @@ struct acm_config_desc { 1195 1202 struct usb_interface_descriptor data_class_interface; 1196 1203 struct usb_endpoint_descriptor … … 1203 1210 1204 1211 static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = { 1205 @@ -179,7 +185,11 @@ 1212 @@ -179,7 +185,11 @@ static struct acm_config_desc acm_config 1206 1213 .bDescriptorType = USB_DT_CONFIG, 1207 1214 .wTotalLength = … … 1215 1222 .iConfiguration = STR_CONFIG, 1216 1223 .bmAttributes = 1217 @@ -278,6 +288,11 @@ 1224 @@ -278,6 +288,11 @@ static struct acm_config_desc acm_config 1218 1225 .bInterval = 0xFF, 1219 1226 }, … … 1227 1234 }; 1228 1235 1229 @@ -390,7 +405,7 @@ 1236 @@ -390,7 +405,7 @@ static int fill_buffer (circbuf_t * buf) 1230 1237 void usbtty_poll (void); 1231 1238 … … 1236 1243 int i; 1237 1244 for (i = 0; i < strlen (str) && str[i]; i++){ 1238 @@ -652,6 +667,9 @@ 1245 @@ -652,6 +667,9 @@ static void usbtty_init_instances (void) 1239 1246 device_instance->bus = bus_instance; 1240 1247 device_instance->configurations = NUM_CONFIGS; … … 1248 1255 Index: u-boot/include/configs/neo1973.h 1249 1256 =================================================================== 1250 --- u-boot.orig/include/configs/neo1973.h 2007-02-28 03:51:25.000000000 +01001251 +++ u-boot/include/configs/neo1973.h 2007-02-28 03:51:25.000000000 +01001257 --- u-boot.orig/include/configs/neo1973.h 1258 +++ u-boot/include/configs/neo1973.h 1252 1259 @@ -165,7 +165,7 @@ 1253 1260 */ … … 1272 1279 Index: u-boot/include/usb_dfu.h 1273 1280 =================================================================== 1274 --- /dev/null 1970-01-01 00:00:00.000000000 +00001275 +++ u-boot/include/usb_dfu.h 2007-02-28 03:51:25.000000000 +01001276 @@ -0,0 +1,9 7@@1281 --- /dev/null 1282 +++ u-boot/include/usb_dfu.h 1283 @@ -0,0 +1,99 @@ 1277 1284 +#ifndef _DFU_H 1278 1285 +#define _DFU_H … … 1366 1373 +#define DFU_EP0_DATA 4 1367 1374 + 1375 +extern volatile enum dfu_state *system_dfu_state; /* for 3rd parties */ 1376 + 1368 1377 +int dfu_ep0_handler(struct urb *urb); 1369 1378 + … … 1374 1383 Index: u-boot/include/usb_dfu_descriptors.h 1375 1384 =================================================================== 1376 --- /dev/null 1970-01-01 00:00:00.000000000 +00001377 +++ u-boot/include/usb_dfu_descriptors.h 2007-02-28 03:51:25.000000000 +01001385 --- /dev/null 1386 +++ u-boot/include/usb_dfu_descriptors.h 1378 1387 @@ -0,0 +1,94 @@ 1379 1388 +#ifndef _USB_DFU_H … … 1473 1482 Index: u-boot/include/usbdcore.h 1474 1483 =================================================================== 1475 --- u-boot.orig/include/usbdcore.h 2007-02-28 03:51:24.000000000 +01001476 +++ u-boot/include/usbdcore.h 2007-02-28 03:51:25.000000000 +01001484 --- u-boot.orig/include/usbdcore.h 1485 +++ u-boot/include/usbdcore.h 1477 1486 @@ -33,6 +33,7 @@ 1478 1487 … … 1483 1492 1484 1493 #define MAX_URBS_QUEUED 5 1485 @@ -475,7 +476,11 @@ 1494 @@ -475,7 +476,11 @@ typedef struct urb_link { 1486 1495 * function driver to inform it that data has arrived. 1487 1496 */ … … 1495 1504 1496 1505 struct usb_endpoint_instance *endpoint; 1497 @@ -603,6 +608,12 @@ 1506 @@ -603,6 +608,12 @@ struct usb_device_instance { 1498 1507 unsigned long usbd_rxtx_timestamp; 1499 1508 unsigned long usbd_last_rxtx_timestamp; … … 1508 1517 1509 1518 /* Bus Interface configuration structure 1510 @@ -632,6 +643,8 @@ 1519 @@ -632,6 +643,8 @@ extern char *usbd_device_status[]; 1511 1520 extern char *usbd_device_requests[]; 1512 1521 extern char *usbd_device_descriptors[]; … … 1519 1528 Index: u-boot/drivers/usbtty.h 1520 1529 =================================================================== 1521 --- u-boot.orig/drivers/usbtty.h 2007-02-28 03:51:25.000000000 +01001522 +++ u-boot/drivers/usbtty.h 2007-02-28 03:51:25.000000000 +01001530 --- u-boot.orig/drivers/usbtty.h 1531 +++ u-boot/drivers/usbtty.h 1523 1532 @@ -71,4 +71,10 @@ 1524 1533 #define STR_CTRL_INTERFACE 0x06 … … 1534 1543 Index: u-boot/include/configs/qt2410.h 1535 1544 =================================================================== 1536 --- u-boot.orig/include/configs/qt2410.h 2007-02-28 03:51:24.000000000 +01001537 +++ u-boot/include/configs/qt2410.h 2007-02-28 03:51:25.000000000 +01001545 --- u-boot.orig/include/configs/qt2410.h 1546 +++ u-boot/include/configs/qt2410.h 1538 1547 @@ -199,7 +199,8 @@ 1539 1548 #define CONFIG_USBD_PRODUCT_NAME "QT2410 Bootloader " U_BOOT_VERSION
Note: See TracChangeset
for help on using the changeset viewer.
