diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/ata_mmc.h | 24 | ||||
-rw-r--r-- | firmware/export/config-e200.h | 5 | ||||
-rw-r--r-- | firmware/export/config.h | 2 | ||||
-rw-r--r-- | firmware/export/hotswap.h | 59 | ||||
-rw-r--r-- | firmware/export/kernel.h | 4 | ||||
-rw-r--r-- | firmware/export/pp5024.h | 2 |
6 files changed, 70 insertions, 26 deletions
diff --git a/firmware/export/ata_mmc.h b/firmware/export/ata_mmc.h index a4e9f71f09..2361c439b5 100644 --- a/firmware/export/ata_mmc.h +++ b/firmware/export/ata_mmc.h | |||
@@ -18,34 +18,14 @@ | |||
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #ifndef __ATA_MMC_H__ | 19 | #ifndef __ATA_MMC_H__ |
20 | #define __ATA_MMC_H__ | 20 | #define __ATA_MMC_H__ |
21 | 21 | #include "hotswap.h" | |
22 | typedef struct | ||
23 | { | ||
24 | bool initialized; | ||
25 | unsigned char bitrate_register; | ||
26 | unsigned long read_timeout; /* n * 8 clock cycles */ | ||
27 | unsigned long write_timeout; /* n * 8 clock cycles */ | ||
28 | |||
29 | unsigned long ocr; /* OCR register */ | ||
30 | unsigned long csd[4]; /* CSD register, 16 bytes */ | ||
31 | unsigned long cid[4]; /* CID register, 16 bytes */ | ||
32 | unsigned long speed; /* bit/s */ | ||
33 | unsigned int nsac; /* clock cycles */ | ||
34 | unsigned long tsac; /* n * 0.1 ns */ | ||
35 | unsigned int r2w_factor; | ||
36 | unsigned long size; /* size in bytes */ | ||
37 | unsigned long numblocks; /* size in flash blocks */ | ||
38 | unsigned int blocksize; /* block size in bytes */ | ||
39 | unsigned int block_exp; /* block size exponent */ | ||
40 | } tCardInfo; | ||
41 | 22 | ||
42 | void mmc_enable_int_flash_clock(bool on); | 23 | void mmc_enable_int_flash_clock(bool on); |
43 | bool mmc_detect(void); | 24 | bool mmc_detect(void); |
44 | unsigned long mmc_extract_bits(const unsigned long *p, unsigned int start, | ||
45 | unsigned int size); | ||
46 | tCardInfo *mmc_card_info(int card_no); | 25 | tCardInfo *mmc_card_info(int card_no); |
47 | bool mmc_touched(void); | 26 | bool mmc_touched(void); |
48 | bool mmc_usb_active(int delayticks); | 27 | bool mmc_usb_active(int delayticks); |
28 | |||
49 | #ifdef HAVE_HOTSWAP | 29 | #ifdef HAVE_HOTSWAP |
50 | void mmc_enable_monitoring(bool on); | 30 | void mmc_enable_monitoring(bool on); |
51 | #endif | 31 | #endif |
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h index 71b1270749..f9708697dc 100644 --- a/firmware/export/config-e200.h +++ b/firmware/export/config-e200.h | |||
@@ -33,6 +33,11 @@ | |||
33 | /* define this if you have LCD enable function */ | 33 | /* define this if you have LCD enable function */ |
34 | #define HAVE_LCD_ENABLE | 34 | #define HAVE_LCD_ENABLE |
35 | 35 | ||
36 | #ifndef SIMULATOR | ||
37 | #define HAVE_HOTSWAP | ||
38 | #define HAVE_MULTIVOLUME | ||
39 | #endif | ||
40 | |||
36 | #define HAVE_BACKLIGHT_BRIGHTNESS | 41 | #define HAVE_BACKLIGHT_BRIGHTNESS |
37 | /* Main LCD backlight brightness range and defaults */ | 42 | /* Main LCD backlight brightness range and defaults */ |
38 | #define MIN_BRIGHTNESS_SETTING 1 | 43 | #define MIN_BRIGHTNESS_SETTING 1 |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 4652359e62..ffcbf688ea 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -247,7 +247,7 @@ | |||
247 | /* Enable the directory cache and tagcache in RAM if we have | 247 | /* Enable the directory cache and tagcache in RAM if we have |
248 | * plenty of RAM. Both features can be enabled independently. */ | 248 | * plenty of RAM. Both features can be enabled independently. */ |
249 | #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \ | 249 | #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \ |
250 | !defined(BOOTLOADER) | 250 | !defined(BOOTLOADER) && !defined(SANSA_E200) |
251 | #define HAVE_DIRCACHE | 251 | #define HAVE_DIRCACHE |
252 | #ifdef HAVE_TAGCACHE | 252 | #ifdef HAVE_TAGCACHE |
253 | #define HAVE_TC_RAMCACHE | 253 | #define HAVE_TC_RAMCACHE |
diff --git a/firmware/export/hotswap.h b/firmware/export/hotswap.h new file mode 100644 index 0000000000..c6a657d731 --- /dev/null +++ b/firmware/export/hotswap.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2004 by Jens Arnold | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef __HOTSWAP_H__ | ||
20 | #define __HOTSWAP_H__ | ||
21 | |||
22 | typedef struct | ||
23 | { | ||
24 | bool initialized; | ||
25 | unsigned char bitrate_register; | ||
26 | unsigned long read_timeout; /* n * 8 clock cycles */ | ||
27 | unsigned long write_timeout; /* n * 8 clock cycles */ | ||
28 | |||
29 | unsigned long ocr; /* OCR register */ | ||
30 | unsigned long csd[4]; /* CSD register, 16 bytes */ | ||
31 | unsigned long cid[4]; /* CID register, 16 bytes */ | ||
32 | unsigned long speed; /* bit/s */ | ||
33 | unsigned int nsac; /* clock cycles */ | ||
34 | unsigned long tsac; /* n * 0.1 ns */ | ||
35 | unsigned int r2w_factor; | ||
36 | unsigned long size; /* size in bytes */ | ||
37 | unsigned long numblocks; /* size in flash blocks */ | ||
38 | unsigned int blocksize; /* block size in bytes */ | ||
39 | unsigned int block_exp; /* block size exponent */ | ||
40 | } tCardInfo; | ||
41 | |||
42 | #ifdef TARGET_TREE | ||
43 | bool card_detect(void); | ||
44 | tCardInfo *card_get_info(int card_no); | ||
45 | #else /* HAVE_MMC */ | ||
46 | #include "ata_mmc.h" | ||
47 | #define card_detect mmc_detect | ||
48 | #define card_get_info mmc_card_info | ||
49 | #define card_touched mmc_touched | ||
50 | #define card_enable_monitoring mmc_enable_monitoring | ||
51 | #endif | ||
52 | |||
53 | /* helper function to extract n (<=32) bits from an arbitrary position. | ||
54 | counting from MSB to LSB */ | ||
55 | unsigned long card_extract_bits( | ||
56 | const unsigned long *p, /* the start of the bitfield array */ | ||
57 | unsigned int start, /* bit no. to start reading */ | ||
58 | unsigned int size); /* how many bits to read */ | ||
59 | #endif | ||
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 9e3a8d25df..d5898a97f1 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h | |||
@@ -41,8 +41,8 @@ | |||
41 | #define SYS_USB_DISCONNECTED ((SYS_EVENT | ((long)3 << 27))) | 41 | #define SYS_USB_DISCONNECTED ((SYS_EVENT | ((long)3 << 27))) |
42 | #define SYS_USB_DISCONNECTED_ACK ((SYS_EVENT | ((long)4 << 27))) | 42 | #define SYS_USB_DISCONNECTED_ACK ((SYS_EVENT | ((long)4 << 27))) |
43 | #define SYS_TIMEOUT ((SYS_EVENT | ((long)5 << 27))) | 43 | #define SYS_TIMEOUT ((SYS_EVENT | ((long)5 << 27))) |
44 | #define SYS_MMC_INSERTED ((SYS_EVENT | ((long)6 << 27))) | 44 | #define SYS_HOTSWAP_INSERTED ((SYS_EVENT | ((long)6 << 27))) |
45 | #define SYS_MMC_EXTRACTED ((SYS_EVENT | ((long)7 << 27))) | 45 | #define SYS_HOTSWAP_EXTRACTED ((SYS_EVENT | ((long)7 << 27))) |
46 | #define SYS_POWEROFF ((SYS_EVENT | ((long)8 << 27))) | 46 | #define SYS_POWEROFF ((SYS_EVENT | ((long)8 << 27))) |
47 | #define SYS_FS_CHANGED ((SYS_EVENT | ((long)9 << 27))) | 47 | #define SYS_FS_CHANGED ((SYS_EVENT | ((long)9 << 27))) |
48 | #define SYS_CHARGER_CONNECTED ((SYS_EVENT | ((long)10 << 27))) | 48 | #define SYS_CHARGER_CONNECTED ((SYS_EVENT | ((long)10 << 27))) |
diff --git a/firmware/export/pp5024.h b/firmware/export/pp5024.h index e7758b9ce5..5e2de17741 100644 --- a/firmware/export/pp5024.h +++ b/firmware/export/pp5024.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "pp5020.h" | 24 | #include "pp5020.h" |
25 | 25 | ||
26 | #undef GPIO_IRQ | 26 | #undef GPIO_IRQ |
27 | /* Ports A, ?? */ | 27 | /* Ports A, B, ?? */ |
28 | #define GPIO0_IRQ (32+0) | 28 | #define GPIO0_IRQ (32+0) |
29 | /* Ports F, H, ?? */ | 29 | /* Ports F, H, ?? */ |
30 | #define GPIO1_IRQ (32+1) | 30 | #define GPIO1_IRQ (32+1) |