summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-01-22 22:05:04 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-01-22 22:05:04 +0000
commitda76a3469437261bd8857c6eddeaafcc601f373e (patch)
tree33e6c461aeb03d28575166c5ed5002aaf8ea9741 /firmware/export
parent81df953da55e75632b5efbe676f2b348e11b2c4b (diff)
downloadrockbox-da76a3469437261bd8857c6eddeaafcc601f373e.tar.gz
rockbox-da76a3469437261bd8857c6eddeaafcc601f373e.zip
Use bus reset detection for all ARC OTG devices. Remove conflict from LV24020LP driver with some GPIO-by-number macros for PP502x. Start monitoring for USB stack once all core threads and queues are created otherwise queues will likely be registered after USB acks. Putting PP502x system_reboot in IRAM (unmapped, uncached) memory seems to help it work more consistently. Hopefully I got all the PP USB connect handlers in the right spot in irq_handler. If device seems unresponsive to cable, check there first.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19819 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/config-c200.h3
-rw-r--r--firmware/export/config-e200.h3
-rw-r--r--firmware/export/config.h13
-rw-r--r--firmware/export/pp5020.h36
-rw-r--r--firmware/export/usb.h3
5 files changed, 46 insertions, 12 deletions
diff --git a/firmware/export/config-c200.h b/firmware/export/config-c200.h
index ff260dc956..d68d21455f 100644
--- a/firmware/export/config-c200.h
+++ b/firmware/export/config-c200.h
@@ -180,9 +180,6 @@
180 180
181/* enable these for the experimental usb stack */ 181/* enable these for the experimental usb stack */
182#define HAVE_USBSTACK 182#define HAVE_USBSTACK
183#ifndef BOOTLOADER
184#define USB_DETECT_BY_DRV
185#endif
186#define USB_VENDOR_ID 0x0781 183#define USB_VENDOR_ID 0x0781
187#define USB_PRODUCT_ID 0x7450 184#define USB_PRODUCT_ID 0x7450
188 185
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h
index 7b27391c64..2be64d95cc 100644
--- a/firmware/export/config-e200.h
+++ b/firmware/export/config-e200.h
@@ -177,9 +177,6 @@
177 177
178/* enable these for the experimental usb stack */ 178/* enable these for the experimental usb stack */
179#define HAVE_USBSTACK 179#define HAVE_USBSTACK
180#ifndef BOOTLOADER
181#define USB_DETECT_BY_DRV
182#endif
183#define USB_VENDOR_ID 0x0781 180#define USB_VENDOR_ID 0x0781
184#define USB_PRODUCT_ID 0x7421 181#define USB_PRODUCT_ID 0x7421
185 182
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 15b137588e..7fb41d8d83 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -439,6 +439,8 @@
439#if CONFIG_CPU == IMX31L 439#if CONFIG_CPU == IMX31L
440/* Priority in bootloader is wanted */ 440/* Priority in bootloader is wanted */
441#define HAVE_PRIORITY_SCHEDULING 441#define HAVE_PRIORITY_SCHEDULING
442#define USB_STATUS_BY_EVENT
443#define USB_DETECT_BY_DRV
442#endif 444#endif
443 445
444#else /* !BOOTLOADER */ 446#else /* !BOOTLOADER */
@@ -452,13 +454,18 @@
452 454
453#define HAVE_SEMAPHORE_OBJECTS 455#define HAVE_SEMAPHORE_OBJECTS
454 456
455#ifdef TOSHIBA_GIGABEAT_F 457#if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC
456#define HAVE_WAKEUP_OBJECTS 458#define USB_STATUS_BY_EVENT
459#define USB_DETECT_BY_DRV
460#if CONFIG_CPU != IMX31L
461#define INCLUDE_TIMEOUT_API
457#endif 462#endif
463#endif /* HAVE_USBSTACK */
458 464
459#endif /* BOOTLOADER */ 465#endif /* BOOTLOADER */
460 466
461#if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) || (CONFIG_CPU == AS3525) 467#if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) \
468 || (CONFIG_CPU == AS3525) || (CONFIG_CPU == S3C2440)
462#define HAVE_WAKEUP_OBJECTS 469#define HAVE_WAKEUP_OBJECTS
463#endif 470#endif
464 471
diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h
index 0f622a907d..36c88e00df 100644
--- a/firmware/export/pp5020.h
+++ b/firmware/export/pp5020.h
@@ -218,6 +218,7 @@
218#define CACHE_OP_INVALIDATE 0x0004 218#define CACHE_OP_INVALIDATE 0x0004
219 219
220/* GPIO Ports */ 220/* GPIO Ports */
221#define GPIO_BASE_ADDR 0x6000d000
221#define GPIOA_ENABLE (*(volatile unsigned long *)(0x6000d000)) 222#define GPIOA_ENABLE (*(volatile unsigned long *)(0x6000d000))
222#define GPIOB_ENABLE (*(volatile unsigned long *)(0x6000d004)) 223#define GPIOB_ENABLE (*(volatile unsigned long *)(0x6000d004))
223#define GPIOC_ENABLE (*(volatile unsigned long *)(0x6000d008)) 224#define GPIOC_ENABLE (*(volatile unsigned long *)(0x6000d008))
@@ -322,10 +323,41 @@
322 * define the value of those bits. */ 323 * define the value of those bits. */
323 324
324#define GPIO_SET_BITWISE(port, mask) \ 325#define GPIO_SET_BITWISE(port, mask) \
325 do { *(&port + (0x800/sizeof(long))) = (mask << 8) | mask; } while(0) 326 do { *(&(port) + (0x800/sizeof(long))) = ((mask) << 8) | (mask); } while(0)
326 327
327#define GPIO_CLEAR_BITWISE(port, mask) \ 328#define GPIO_CLEAR_BITWISE(port, mask) \
328 do { *(&port + (0x800/sizeof(long))) = mask << 8; } while(0) 329 do { *(&(port) + (0x800/sizeof(long))) = (mask) << 8; } while(0)
330
331#define GPIO_WRITE_BITWISE(port, val, mask) \
332 do { *(&(port) + (0x800/sizeof(long))) = ((mask) << 8) | (val); } while(0)
333
334/* GPIO Module 0 */
335#define GPIOA 0
336#define GPIOB 1
337#define GPIOC 2
338#define GPIOD 3
339/* GPIO Module 1 */
340#define GPIOE 4
341#define GPIOF 5
342#define GPIOG 6
343#define GPIOH 7
344/* GPIO Module 2 */
345#define GPIOI 8
346#define GPIOJ 9
347#define GPIOK 10
348#define GPIOL 11
349
350#define GPIO_MODULE_NUM(gpio) ((gpio)>>2)
351#define GPIO_MAP_ADDR(gpio) (GPIO_BASE_ADDR+(GPIO_MODULE_NUM(gpio)<<7)+(((gpio)&3)<<2))
352#define GPIO_ENABLE(gpio) (*(volatile unsigned long *)(GPIO_MAP_ADDR(gpio)+0x00))
353#define GPIO_OUTPUT_EN(gpio) (*(volatile unsigned long *)(GPIO_MAP_ADDR(gpio)+0x10))
354#define GPIO_OUTPUT_VAL(gpio) (*(volatile unsigned long *)(GPIO_MAP_ADDR(gpio)+0x20))
355#define GPIO_INPUT_VAL(gpio) (*(volatile unsigned long *)(GPIO_MAP_ADDR(gpio)+0x30))
356#define GPIO_INT_STAT(gpio) (*(volatile unsigned long *)(GPIO_MAP_ADDR(gpio)+0x40))
357#define GPIO_INT_EN(gpio) (*(volatile unsigned long *)(GPIO_MAP_ADDR(gpio)+0x50))
358#define GPIO_INT_LEV(gpio) (*(volatile unsigned long *)(GPIO_MAP_ADDR(gpio)+0x60))
359#define GPIO_INT_CLR(gpio) (*(volatile unsigned long *)(GPIO_MAP_ADDR(gpio)+0x70))
360#define GPIO_HI_INT_MASK(gpio) (1ul << GPIO_MODULE_NUM(gpio))
329 361
330/* Device initialization */ 362/* Device initialization */
331#define PP_VER1 (*(volatile unsigned long *)(0x70000000)) 363#define PP_VER1 (*(volatile unsigned long *)(0x70000000))
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index 0a0539a622..90713594a5 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -31,8 +31,8 @@
31 31
32/* Messages from usb_tick and thread states */ 32/* Messages from usb_tick and thread states */
33enum { 33enum {
34 USB_EXTRACTED = 0, /* Event+State */
34 USB_INSERTED, /* Event+State */ 35 USB_INSERTED, /* Event+State */
35 USB_EXTRACTED, /* Event+State */
36#if defined(HAVE_USB_POWER) || defined(USB_DETECT_BY_DRV) 36#if defined(HAVE_USB_POWER) || defined(USB_DETECT_BY_DRV)
37 USB_POWERED, /* Event+State */ 37 USB_POWERED, /* Event+State */
38#endif 38#endif
@@ -135,6 +135,7 @@ bool usb_exclusive_storage(void); /* storage is available for usb */
135 135
136#ifdef USB_FIREWIRE_HANDLING 136#ifdef USB_FIREWIRE_HANDLING
137bool firewire_detect(void); 137bool firewire_detect(void);
138void usb_firewire_connect_event(void);
138#endif 139#endif
139 140
140#endif 141#endif