summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-16 21:05:18 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-16 21:05:18 +0000
commit7a8fc3fd9db99fa16976baf7e78059ad766a3ce5 (patch)
tree54a71f42ca8810c3bf635834cb2a66fd0b64038c
parent2ea6da1ebf328a2f9565fe596c774828fd018f2f (diff)
downloadrockbox-7a8fc3fd9db99fa16976baf7e78059ad766a3ce5.zip
rockbox-7a8fc3fd9db99fa16976baf7e78059ad766a3ce5.tar.gz
rockbox-7a8fc3fd9db99fa16976baf7e78059ad766a3ce5.tar.bz2
rockbox-7a8fc3fd9db99fa16976baf7e78059ad766a3ce5.tar.xz
1) Put USB in IRAM
2) Use defines from usb_drv.h git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17546 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/isp1583.c6
-rw-r--r--firmware/export/isp1583.h24
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c2
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/usb-target.h4
4 files changed, 14 insertions, 22 deletions
diff --git a/firmware/drivers/isp1583.c b/firmware/drivers/isp1583.c
index 7e78f87..4ad6ad2 100644
--- a/firmware/drivers/isp1583.c
+++ b/firmware/drivers/isp1583.c
@@ -19,7 +19,6 @@
****************************************************************************/
#include "config.h"
-#include "usb-target.h"
#include "usb_ch9.h"
#include "usb_drv.h"
#include "usb_core.h"
@@ -30,9 +29,6 @@
#define DIR_RX 0
#define DIR_TX 1
-
-#define DIR_OUT 0
-#define DIR_IN 1
struct usb_endpoint
{
@@ -626,7 +622,7 @@ static void bus_reset(void)
}
/* Method for handling interrupts, must be called from usb-<target>.c */
-void usb_drv_int(void)
+void IRAM_ATTR usb_drv_int(void)
{
unsigned long ints;
ints = ISP1583_GEN_INT_READ & ISP1583_INIT_INTEN_READ;
diff --git a/firmware/export/isp1583.h b/firmware/export/isp1583.h
index 3ffbbed..5a5840a 100644
--- a/firmware/export/isp1583.h
+++ b/firmware/export/isp1583.h
@@ -19,6 +19,8 @@
#ifndef ISP1583_H
#define ISP1583_H
+#include "usb-target.h"
+
#ifndef ISP1583_H_OVERRIDE
/* Initialization registers */
#define ISP1583_INIT_ADDRESS (*((volatile unsigned char*)(ISP1583_IOBASE+0x0)))
@@ -166,20 +168,12 @@
#define STANDARD_INTEN ( INIT_INTEN_IEBRST | INIT_INTEN_IEHS_STA | INT_IESUSP | INT_IERESM | INIT_INTEN_IEVBUS | INIT_INTEN_IEP0SETUP | INIT_INTEN_IEP0RX | INIT_INTEN_IEP0TX )
#define STANDARD_INIT_MODE ( INIT_MODE_CLKAON | INIT_MODE_GLINTENA )
-bool usb_drv_powered(void);
-void usb_drv_init(void);
-int usb_drv_port_speed(void);
-void usb_drv_exit(void);
-void usb_drv_stall(int endpoint, bool stall, bool in);
-bool usb_drv_stalled(int endpoint, bool in);
-int usb_drv_recv(int ep, void* ptr, int length);
-int usb_drv_send_nonblocking(int ep, void* ptr, int length);
-int usb_drv_send(int endpoint, void* ptr, int length);
-void usb_drv_reset_endpoint(int ep, bool send);
-void usb_drv_wait(int ep, bool send);
-void usb_drv_cancel_all_transfers(void);
-void usb_drv_set_address(int address);
-void usb_drv_set_test_mode(int mode);
-void usb_drv_int(void); /* Method for handling interrupts, must be called from usb-<target>.c */
+#ifdef USE_IRAM
+ #define IRAM_ATTR __attribute__ ((section(".icode")))
+#else
+ #define IRAM_ATTR
+#endif
+
+#include "usb_drv.h"
#endif
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c
index 6bbd08c..a9995a5 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c
@@ -54,7 +54,7 @@ void usb_enable(bool on)
usb_core_exit();
}
-void GIO7(void)
+void IRAM_ATTR GIO7(void)
{
#ifdef DEBUG
//printf("GIO7 interrupt... [%d]", current_tick);
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h b/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h
index 14ddc6e..0741474 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h
+++ b/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h
@@ -69,7 +69,9 @@
: : : "r12")
//#define ZVM_SPECIFIC
-#include "kernel.h"
+#define USE_IRAM
+
+#include <stdbool.h>
int usb_detect(void);
void usb_init_device(void);
bool usb_drv_connected(void);