summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-01-15 08:19:30 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-01-15 08:19:30 +0000
commit3a1127785b9f29e526b2ab845efe0a313699c459 (patch)
treec16f2071dcdd1f1388b0216643a8f4a979023b9f /firmware/export
parent53db95417dc919a50e55b6f6b1f9852e1bdf8816 (diff)
downloadrockbox-3a1127785b9f29e526b2ab845efe0a313699c459.zip
rockbox-3a1127785b9f29e526b2ab845efe0a313699c459.tar.gz
rockbox-3a1127785b9f29e526b2ab845efe0a313699c459.tar.bz2
rockbox-3a1127785b9f29e526b2ab845efe0a313699c459.tar.xz
Bootloader USB mode for PP502x. Enable only on GoGear SA9200 for the time being. Add HAVE_BOOTLOADER_USB_MODE to config if BOOTLOADER is defined to enable it. Clean up some kernel stuff a little to support it. Mess up a bunch of other stuff (hopefully not too badly).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29053 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/config.h6
-rw-r--r--firmware/export/config/gigabeats.h4
-rw-r--r--firmware/export/config/gogearsa9200.h7
-rw-r--r--firmware/export/kernel.h7
-rw-r--r--firmware/export/pp5020.h3
-rw-r--r--firmware/export/sd.h4
-rw-r--r--firmware/export/storage.h1
-rw-r--r--firmware/export/usb.h3
8 files changed, 25 insertions, 10 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h
index eca736d..c77e673 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -693,7 +693,7 @@ Lyre prototype 1 */
#if (CONFIG_CODEC == SWCODEC)
#ifdef BOOTLOADER
-#if CONFIG_CPU == IMX31L
+#ifdef HAVE_BOOTLOADER_USB_MODE
/* Priority in bootloader is wanted */
#define HAVE_PRIORITY_SCHEDULING
#define USB_STATUS_BY_EVENT
@@ -964,8 +964,8 @@ Lyre prototype 1 */
#ifdef BOOTLOADER
/* enable usb storage for targets that do bootloader usb */
-#if (defined(TOSHIBA_GIGABEAT_S) || \
- (defined(CREATIVE_ZVx) || \
+#if defined(HAVE_BOOTLOADER_USB_MODE) || \
+ ((defined(CREATIVE_ZVx) || \
defined(CPU_TCC77X) || defined(CPU_TCC780X))) || \
(CONFIG_USBOTG == USBOTG_JZ4740) || defined(IPOD_NANO2G) || \
CONFIG_USBOTG == USBOTG_AS3525
diff --git a/firmware/export/config/gigabeats.h b/firmware/export/config/gigabeats.h
index cf560aa..3b3a717 100644
--- a/firmware/export/config/gigabeats.h
+++ b/firmware/export/config/gigabeats.h
@@ -217,6 +217,10 @@
#define USB_VENDOR_ID 0x0930
#define USB_PRODUCT_ID 0x0010
#define HAVE_USB_HID_MOUSE
+#ifdef BOOTLOADER
+/* enable bootloader USB mode - ONLY define when also BOOTLOADER */
+#define HAVE_BOOTLOADER_USB_MODE
+#endif
/* Define this if you have ATA power-off control */
#define HAVE_ATA_POWER_OFF
diff --git a/firmware/export/config/gogearsa9200.h b/firmware/export/config/gogearsa9200.h
index 2d777f1..23561e1 100644
--- a/firmware/export/config/gogearsa9200.h
+++ b/firmware/export/config/gogearsa9200.h
@@ -172,10 +172,9 @@
#define USB_VENDOR_ID 0x0471
#define USB_PRODUCT_ID 0x014f
#define HAVE_USB_HID_MOUSE
-
-/* WARNING! Enable Rockbox USB mass storage. */
-#ifndef BOOTLOADER
-#define USE_ROCKBOX_USB
+#ifdef BOOTLOADER
+/* enable bootloader USB mode - ONLY define when also BOOTLOADER */
+#define HAVE_BOOTLOADER_USB_MODE
#endif
/* Define this if you have adjustable CPU frequency */
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index 4656d87..cfc7a23 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -178,9 +178,10 @@ struct wakeup
/* global tick variable */
-#if defined(CPU_PP) && defined(BOOTLOADER)
-/* We don't enable interrupts in the iPod bootloader, so we need to fake
- the current_tick variable */
+#if defined(CPU_PP) && defined(BOOTLOADER) && \
+ !defined(HAVE_BOOTLOADER_USB_MODE)
+/* We don't enable interrupts in the PP bootloader unless USB mode is
+ enabled for it, so we need to fake the current_tick variable */
#define current_tick (signed)(USEC_TIMER/10000)
static inline void call_tick_tasks(void)
diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h
index 5b5864f..073d33e 100644
--- a/firmware/export/pp5020.h
+++ b/firmware/export/pp5020.h
@@ -224,6 +224,9 @@
#define CACHE_OP_FLUSH 0x0002
#define CACHE_OP_INVALIDATE 0x0004
+/* Local interrupt vector table (set CACHE_CTL_VECT_REMAP to enable) */
+#define INT_VECTOR_ENTRY(v) (*((volatile unsigned long *)(0x6000f100) + (v)))
+
/* GPIO Ports */
#define GPIO_BASE_ADDR 0x6000d000
#define GPIOA_ENABLE (*(volatile unsigned long *)(0x6000d000))
diff --git a/firmware/export/sd.h b/firmware/export/sd.h
index c798f54..8e400bf 100644
--- a/firmware/export/sd.h
+++ b/firmware/export/sd.h
@@ -25,6 +25,10 @@
#include <stdbool.h>
#include "mv.h" /* for HAVE_MULTIDRIVE or not */
+#ifdef HAVE_BOOTLOADER_USB_MODE
+#define SD_DRIVER_CLOSE
+#endif
+
#define SD_BLOCK_SIZE 512 /* XXX : support other sizes ? */
struct storage_info;
diff --git a/firmware/export/storage.h b/firmware/export/storage.h
index faceb2b..e9ac8b4 100644
--- a/firmware/export/storage.h
+++ b/firmware/export/storage.h
@@ -112,6 +112,7 @@ static inline void stub_storage_spindown(int timeout) { (void)timeout; }
#define storage_disk_is_active() 0
#define storage_soft_reset() (void)0
#define storage_init() sd_init()
+ #define storage_close() sd_close()
#ifdef HAVE_STORAGE_FLUSH
#define storage_flush() (void)0
#endif
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index 3e236bf..e192748 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -55,6 +55,9 @@ enum {
#if defined(HAVE_USB_CHARGING_ENABLE) && defined(HAVE_USBSTACK)
USB_CHARGER_UPDATE, /* Event */
#endif
+#ifdef HAVE_BOOTLOADER_USB_MODE
+ USB_HANDLED, /* Bootloader status code */
+#endif
};
#ifdef HAVE_USB_POWER