diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2009-01-19 13:41:25 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2009-01-19 13:41:25 +0000 |
commit | 616c98b38f6ddac0ac3dde8ec0fa248f835717e2 (patch) | |
tree | 5eeeabb85fbefa162a438edca88611c1bc688269 /firmware/export | |
parent | cef6399c4c3bcaa35733bdab8b9016b66b71a6f0 (diff) | |
download | rockbox-616c98b38f6ddac0ac3dde8ec0fa248f835717e2.tar.gz rockbox-616c98b38f6ddac0ac3dde8ec0fa248f835717e2.zip |
USB detection changes. c200/e200: Consider USB to be powered when charger is plugged but detect USB connection by bus reset. When received, disconnect and restart the driver fully enabled. imx31: Fix hack used to make initial connect succeeded-- set PHY type before initial reset. General: Move some target code out of usb-drv-arc.c and implement it in respective usb sources and CPU headers so things stay clean.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19797 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/config-c200.h | 3 | ||||
-rw-r--r-- | firmware/export/config-e200.h | 3 | ||||
-rw-r--r-- | firmware/export/config-gigabeat-s.h | 6 | ||||
-rwxr-xr-x | firmware/export/imx31l.h | 8 | ||||
-rw-r--r-- | firmware/export/pp5020.h | 7 | ||||
-rw-r--r-- | firmware/export/usb.h | 8 | ||||
-rw-r--r-- | firmware/export/usb_core.h | 10 | ||||
-rw-r--r-- | firmware/export/usb_drv.h | 6 |
8 files changed, 33 insertions, 18 deletions
diff --git a/firmware/export/config-c200.h b/firmware/export/config-c200.h index d68d21455f..ff260dc956 100644 --- a/firmware/export/config-c200.h +++ b/firmware/export/config-c200.h | |||
@@ -180,6 +180,9 @@ | |||
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 | ||
183 | #define USB_VENDOR_ID 0x0781 | 186 | #define USB_VENDOR_ID 0x0781 |
184 | #define USB_PRODUCT_ID 0x7450 | 187 | #define USB_PRODUCT_ID 0x7450 |
185 | 188 | ||
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h index 2be64d95cc..7b27391c64 100644 --- a/firmware/export/config-e200.h +++ b/firmware/export/config-e200.h | |||
@@ -177,6 +177,9 @@ | |||
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 | ||
180 | #define USB_VENDOR_ID 0x0781 | 183 | #define USB_VENDOR_ID 0x0781 |
181 | #define USB_PRODUCT_ID 0x7421 | 184 | #define USB_PRODUCT_ID 0x7421 |
182 | 185 | ||
diff --git a/firmware/export/config-gigabeat-s.h b/firmware/export/config-gigabeat-s.h index 64f351c1ce..9e6029f00b 100644 --- a/firmware/export/config-gigabeat-s.h +++ b/firmware/export/config-gigabeat-s.h | |||
@@ -176,10 +176,12 @@ | |||
176 | /* USB On-the-go */ | 176 | /* USB On-the-go */ |
177 | #define CONFIG_USBOTG USBOTG_ARC | 177 | #define CONFIG_USBOTG USBOTG_ARC |
178 | 178 | ||
179 | /* enable these for the experimental usb stack */ | 179 | /* enable these for the usb stack */ |
180 | #define USE_ROCKBOX_USB | 180 | #define USE_ROCKBOX_USB |
181 | #define HAVE_USBSTACK | 181 | #define HAVE_USBSTACK |
182 | #define USB_STORAGE | 182 | #define USB_STORAGE |
183 | /* usb stack and driver settings */ | ||
184 | #define USB_PORTSCX_PHY_TYPE PORTSCX_PTS_ULPI | ||
183 | #define USB_VENDOR_ID 0x0930 | 185 | #define USB_VENDOR_ID 0x0930 |
184 | #define USB_PRODUCT_ID 0x0010 | 186 | #define USB_PRODUCT_ID 0x0010 |
185 | 187 | ||
@@ -201,7 +203,7 @@ | |||
201 | /* Offset ( in the firmware file's header ) to the real data */ | 203 | /* Offset ( in the firmware file's header ) to the real data */ |
202 | #define FIRMWARE_OFFSET_FILE_DATA 8 | 204 | #define FIRMWARE_OFFSET_FILE_DATA 8 |
203 | 205 | ||
204 | #define HAVE_SERIAL | 206 | //#define HAVE_SERIAL |
205 | #define HAVE_VOLUME_IN_LIST | 207 | #define HAVE_VOLUME_IN_LIST |
206 | 208 | ||
207 | /*Remove Comments from UART_INT to enable the UART interrupts,*/ | 209 | /*Remove Comments from UART_INT to enable the UART interrupts,*/ |
diff --git a/firmware/export/imx31l.h b/firmware/export/imx31l.h index b572c788a9..b55a56b105 100755 --- a/firmware/export/imx31l.h +++ b/firmware/export/imx31l.h | |||
@@ -36,7 +36,11 @@ | |||
36 | #define FRAME_SIZE (240*320*2) | 36 | #define FRAME_SIZE (240*320*2) |
37 | 37 | ||
38 | #define DEVBSS_ATTR __attribute__((section(".devbss"),nocommon)) | 38 | #define DEVBSS_ATTR __attribute__((section(".devbss"),nocommon)) |
39 | #define QHARRAY_ATTR __attribute__((section(".qharray"),nocommon)) | 39 | /* USBOTG */ |
40 | #define USB_QHARRAY_ATTR __attribute__((section(".qharray"),nocommon,aligned(2048))) | ||
41 | #define USB_NUM_ENDPOINTS 8 | ||
42 | #define USB_DEVBSS_ATTR DEVBSS_ATTR | ||
43 | #define USB_BASE OTG_BASE_ADDR | ||
40 | 44 | ||
41 | /* | 45 | /* |
42 | * AIPS 1 | 46 | * AIPS 1 |
@@ -1580,6 +1584,4 @@ | |||
1580 | #define UART_FIFO_CTRL 0x881 | 1584 | #define UART_FIFO_CTRL 0x881 |
1581 | #define TIMEOUT 1000 | 1585 | #define TIMEOUT 1000 |
1582 | 1586 | ||
1583 | #define USB_BASE OTG_BASE_ADDR | ||
1584 | |||
1585 | #endif /* __IMX31L_H__ */ | 1587 | #endif /* __IMX31L_H__ */ |
diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h index b4919a219e..0f622a907d 100644 --- a/firmware/export/pp5020.h +++ b/firmware/export/pp5020.h | |||
@@ -23,7 +23,12 @@ | |||
23 | 23 | ||
24 | /* All info gleaned and/or copied from the iPodLinux project. */ | 24 | /* All info gleaned and/or copied from the iPodLinux project. */ |
25 | 25 | ||
26 | #define QHARRAY_ATTR __attribute__((section(".qharray"),nocommon)) | 26 | /* USBOTG */ |
27 | #define USB_NUM_ENDPOINTS 3 | ||
28 | /* This needs to be 2048 byte aligned, but USB_QHARRAY_ATTR should take care | ||
29 | * of that */ | ||
30 | #define USB_QHARRAY_ATTR __attribute__((section(".qharray"),nocommon,aligned(4))) | ||
31 | #define USB_DEVBSS_ATTR IBSS_ATTR | ||
27 | 32 | ||
28 | /* DRAM starts at 0x10000000, but in Rockbox we remap it to 0x00000000 */ | 33 | /* DRAM starts at 0x10000000, but in Rockbox we remap it to 0x00000000 */ |
29 | #define DRAM_START 0x10000000 | 34 | #define DRAM_START 0x10000000 |
diff --git a/firmware/export/usb.h b/firmware/export/usb.h index a6cfad5889..0a0539a622 100644 --- a/firmware/export/usb.h +++ b/firmware/export/usb.h | |||
@@ -33,8 +33,11 @@ | |||
33 | enum { | 33 | enum { |
34 | USB_INSERTED, /* Event+State */ | 34 | USB_INSERTED, /* Event+State */ |
35 | USB_EXTRACTED, /* Event+State */ | 35 | USB_EXTRACTED, /* Event+State */ |
36 | #ifdef HAVE_USB_POWER | 36 | #if defined(HAVE_USB_POWER) || defined(USB_DETECT_BY_DRV) |
37 | USB_POWERED, /* State */ | 37 | USB_POWERED, /* Event+State */ |
38 | #endif | ||
39 | #ifdef USB_DETECT_BY_DRV | ||
40 | USB_UNPOWERED, /* Event */ | ||
38 | #endif | 41 | #endif |
39 | #ifdef HAVE_LCD_BITMAP | 42 | #ifdef HAVE_LCD_BITMAP |
40 | USB_SCREENDUMP, /* State */ | 43 | USB_SCREENDUMP, /* State */ |
@@ -107,6 +110,7 @@ struct usb_transfer_completion_event_data | |||
107 | 110 | ||
108 | void usb_init(void); | 111 | void usb_init(void); |
109 | void usb_enable(bool on); | 112 | void usb_enable(bool on); |
113 | void usb_attach(void); | ||
110 | void usb_start_monitoring(void); | 114 | void usb_start_monitoring(void); |
111 | void usb_close(void); | 115 | void usb_close(void); |
112 | void usb_acknowledge(long id); | 116 | void usb_acknowledge(long id); |
diff --git a/firmware/export/usb_core.h b/firmware/export/usb_core.h index 7af8e43c8d..d0c8270d93 100644 --- a/firmware/export/usb_core.h +++ b/firmware/export/usb_core.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2007 by Bjรถrn Stenberg | 10 | * Copyright (C) 2007 by Bj๖rn Stenberg |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or | 12 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 13 | * modify it under the terms of the GNU General Public License |
@@ -35,14 +35,6 @@ | |||
35 | 35 | ||
36 | /* endpoints */ | 36 | /* endpoints */ |
37 | #define EP_CONTROL 0 | 37 | #define EP_CONTROL 0 |
38 | #if CONFIG_CPU == IMX31L | ||
39 | #define NUM_ENDPOINTS 8 | ||
40 | #define USBDEVBSS_ATTR DEVBSS_ATTR | ||
41 | #else | ||
42 | #define USBDEVBSS_ATTR IBSS_ATTR | ||
43 | #define NUM_ENDPOINTS 3 | ||
44 | #endif | ||
45 | |||
46 | extern int usb_max_pkt_size; | 38 | extern int usb_max_pkt_size; |
47 | 39 | ||
48 | struct usb_class_driver; | 40 | struct usb_class_driver; |
diff --git a/firmware/export/usb_drv.h b/firmware/export/usb_drv.h index 3d2e689050..23f6f4ce2a 100644 --- a/firmware/export/usb_drv.h +++ b/firmware/export/usb_drv.h | |||
@@ -24,9 +24,13 @@ | |||
24 | #include "kernel.h" | 24 | #include "kernel.h" |
25 | 25 | ||
26 | void usb_drv_startup(void); | 26 | void usb_drv_startup(void); |
27 | void usb_drv_usb_detect_event(void); /* Target implemented */ | ||
28 | void usb_drv_int_enable(bool enable); /* Target implemented */ | ||
29 | void usb_drv_reset(void); | ||
27 | void usb_drv_init(void); | 30 | void usb_drv_init(void); |
28 | void usb_drv_exit(void); | 31 | void usb_drv_exit(void); |
29 | void usb_drv_int(void); | 32 | void usb_drv_attach(void); |
33 | void usb_drv_int(void); /* Call from target INT handler */ | ||
30 | void usb_drv_stall(int endpoint, bool stall,bool in); | 34 | void usb_drv_stall(int endpoint, bool stall,bool in); |
31 | bool usb_drv_stalled(int endpoint,bool in); | 35 | bool usb_drv_stalled(int endpoint,bool in); |
32 | int usb_drv_send(int endpoint, void* ptr, int length); | 36 | int usb_drv_send(int endpoint, void* ptr, int length); |