summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/ata.h20
-rw-r--r--firmware/export/config.h51
-rw-r--r--firmware/export/config/cowond2.h3
-rw-r--r--firmware/export/config/creativezen.h1
-rw-r--r--firmware/export/config/creativezenxfi.h1
-rw-r--r--firmware/export/config/creativezenxfi2.h1
-rw-r--r--firmware/export/config/creativezenxfi3.h1
-rw-r--r--firmware/export/config/erosqnative.h2
-rw-r--r--firmware/export/config/fiiom3k.h2
-rw-r--r--firmware/export/config/ihifi760.h3
-rw-r--r--firmware/export/config/ihifi770.h7
-rw-r--r--firmware/export/config/ihifi770c.h7
-rw-r--r--firmware/export/config/ihifi800.h7
-rw-r--r--firmware/export/config/ihifi960.h2
-rw-r--r--firmware/export/config/mini2440.h3
-rw-r--r--firmware/export/config/ondavx747.h4
-rw-r--r--firmware/export/config/ondavx777.h4
-rw-r--r--firmware/export/config/rk27generic.h2
-rw-r--r--firmware/export/config/sansae200.h1
-rw-r--r--firmware/export/config/shanlingq1.h2
-rw-r--r--firmware/export/config/xduoox3.h4
-rw-r--r--firmware/export/disk.h4
-rw-r--r--firmware/export/fat.h4
-rw-r--r--firmware/export/hostfs.h4
-rw-r--r--firmware/export/mmc.h4
-rw-r--r--firmware/export/mv.h19
-rw-r--r--firmware/export/nand.h4
-rw-r--r--firmware/export/pathfuncs.h2
-rw-r--r--firmware/export/ramdisk.h4
-rw-r--r--firmware/export/rbpaths.h6
-rw-r--r--firmware/export/sd.h5
-rw-r--r--firmware/export/sdmmc.h8
-rw-r--r--firmware/export/storage.h15
33 files changed, 117 insertions, 90 deletions
diff --git a/firmware/export/ata.h b/firmware/export/ata.h
index 62c9467643..6165eaf633 100644
--- a/firmware/export/ata.h
+++ b/firmware/export/ata.h
@@ -140,8 +140,8 @@ bool ata_disk_is_active(void);
140int ata_soft_reset(void); 140int ata_soft_reset(void);
141int ata_init(void) STORAGE_INIT_ATTR; 141int ata_init(void) STORAGE_INIT_ATTR;
142void ata_close(void); 142void ata_close(void);
143int ata_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); 143int ata_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf);
144int ata_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); 144int ata_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf);
145void ata_spin(void); 145void ata_spin(void);
146#if (CONFIG_LED == LED_REAL) 146#if (CONFIG_LED == LED_REAL)
147void ata_set_led_enabled(bool enabled); 147void ata_set_led_enabled(bool enabled);
@@ -191,22 +191,22 @@ static inline int ata_disk_isssd(void)
191 However microdrives pose a problem as they support CFA but are not 191 However microdrives pose a problem as they support CFA but are not
192 SSD. 192 SSD.
193 193
194 Offset 163 shows CF Advanced timing modes; microdrives all seems to
195 report 0, but all others (including iFlash) report higher! This
196 is often present even when the "CFA supported" bit is 0.
197
194 Offset 160 b15 indicates support for CF+ power level 1, if not set 198 Offset 160 b15 indicates support for CF+ power level 1, if not set
195 then device is standard flash CF. However this is not foolproof 199 then device is standard flash CF. However this is not foolproof
196 as newer CF cards may support it for extra performance. 200 as newer CF cards (and those CF->SD adapters) may report this.
197
198 Offset 163 shows CF Advanced timing modes; microdrive seems to
199 report 0, but all others (including iFlash) report higher!
200 201
201 So if device support CFA _AND_ reports higher speeds modes, it is SSD.
202 202
203 */ 203 */
204 return ( (identify_info[217] == 0x0001 || identify_info[217] == 0x0100) /* "Solid state" rotational rate */ 204 return ( (identify_info[217] == 0x0001 || identify_info[217] == 0x0100) /* "Solid state" rotational rate */
205 || ((identify_info[168] & 0x0f) >= 0x06) /* Explicit SSD form factors */ 205 || ((identify_info[168] & 0x0f) >= 0x06) /* Explicit SSD form factors */
206 || (identify_info[169] & (1<<0)) /* TRIM supported */ 206 || (identify_info[169] & (1<<0)) /* TRIM supported */
207 || (identify_info[163] > 0) /* CF Advanced timing modes */
207 || ((identify_info[83] & (1<<2)) && /* CFA compliant */ 208 || ((identify_info[83] & (1<<2)) && /* CFA compliant */
208 (((identify_info[160] & (1<<15)) == 0) || /* CF level 0 */ 209 ((identify_info[160] & (1<<15)) == 0)) /* CF power level 0 */
209 (identify_info[163] > 0))) /* Advanced timing modes */
210 ); 210 );
211} 211}
212 212
@@ -233,4 +233,6 @@ int ata_read_smart(struct ata_smart_values*);
233#define STORAGE_CLOSE 233#define STORAGE_CLOSE
234#endif 234#endif
235 235
236#define ATA_IDENTIFY_WORDS 256
237
236#endif /* __ATA_H__ */ 238#endif /* __ATA_H__ */
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 5ea5c71c70..ede1825f88 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -868,22 +868,41 @@ Lyre prototype 1 */
868#define CONFIG_STORAGE_MULTI 868#define CONFIG_STORAGE_MULTI
869#endif 869#endif
870 870
871/* Explicit HAVE_MULTIVOLUME in the config file. Allow the maximum number */
872#ifdef HAVE_MULTIVOLUME
873#define NUM_VOLUMES_PER_DRIVE 4
874#else
875#define NUM_VOLUMES_PER_DRIVE 1
876#endif
877#if defined(CONFIG_STORAGE_MULTI) && !defined(HAVE_MULTIDRIVE) 871#if defined(CONFIG_STORAGE_MULTI) && !defined(HAVE_MULTIDRIVE)
878#define HAVE_MULTIDRIVE 872#define HAVE_MULTIDRIVE
879#endif 873#endif
880 874
881#if defined(HAVE_MULTIDRIVE) && !defined(HAVE_MULTIVOLUME) 875#if defined(HAVE_MULTIDRIVE) && !defined(NUM_DRIVES)
876#error HAVE_MULTIDRIVE needs to have an explicit NUM_DRIVES
877#endif
878
879#ifndef NUM_DRIVES
880#define NUM_DRIVES 1
881#endif
882
883#if !defined(HAVE_MULTIVOLUME)
884#if defined(HAVE_MULTIDRIVE)
885/* Multidrive strongly implies multivolume */
886#define HAVE_MULTIVOLUME
887#elif (CONFIG_STORAGE & STORAGE_SD)
888/* SD routinely have multiple partitions */
889#elif (CONFIG_STORAGE & STORAGE_ATA) && defined(HAVE_LBA48)
890/* ATA routinely haves multiple partitions, but don't bother if we can't do LBA48 */
882#define HAVE_MULTIVOLUME 891#define HAVE_MULTIVOLUME
883#endif 892#endif
893#endif
884 894
885#if defined(HAVE_MULTIDRIVE) && !defined(NUM_DRIVES) 895/* Bootloaders don't need multivolume awareness */
886#error HAVE_MULTIDRIVE needs to have an explicit NUM_DRIVES 896#if defined(BOOTLOADER) && defined(HAVE_MULTIVOLUME) \
897 && !(CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(BOOT_REDIR)
898#undef HAVE_MULTIVOLUME
899#endif
900
901/* Number of volumes per drive */
902#if defined(HAVE_MULTIVOLUME) && !defined(SIMULATOR) && !(CONFIG_PLATFORM & PLATFORM_HOSTED)
903#define NUM_VOLUMES_PER_DRIVE 4
904#else
905#define NUM_VOLUMES_PER_DRIVE 1
887#endif 906#endif
888 907
889/* note to remove multi-partition booting this could be changed to MULTIDRIVE */ 908/* note to remove multi-partition booting this could be changed to MULTIDRIVE */
@@ -897,10 +916,6 @@ Lyre prototype 1 */
897# define MULTIBOOT_MIN_VOLUME 0 916# define MULTIBOOT_MIN_VOLUME 0
898#endif 917#endif
899 918
900#ifndef NUM_DRIVES
901#define NUM_DRIVES 1
902#endif
903
904#define NUM_VOLUMES (NUM_DRIVES * NUM_VOLUMES_PER_DRIVE) 919#define NUM_VOLUMES (NUM_DRIVES * NUM_VOLUMES_PER_DRIVE)
905 920
906#if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ) 921#if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
@@ -934,31 +949,35 @@ Lyre prototype 1 */
934#ifdef HAVE_BOOTLOADER_USB_MODE 949#ifdef HAVE_BOOTLOADER_USB_MODE
935/* Priority in bootloader is wanted */ 950/* Priority in bootloader is wanted */
936#define HAVE_PRIORITY_SCHEDULING 951#define HAVE_PRIORITY_SCHEDULING
952
937#if (CONFIG_CPU == S5L8702) 953#if (CONFIG_CPU == S5L8702)
938#define USB_DRIVER_CLOSE 954#define USB_DRIVER_CLOSE
939#else 955#else
940#define USB_STATUS_BY_EVENT 956#define USB_STATUS_BY_EVENT
941#define USB_DETECT_BY_REQUEST 957#define USB_DETECT_BY_REQUEST
942#endif 958#endif
959
943#if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC 960#if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC
944#define INCLUDE_TIMEOUT_API 961#define INCLUDE_TIMEOUT_API
945#define USB_DRIVER_CLOSE 962#define USB_DRIVER_CLOSE
946#endif 963#endif
964
947#if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_TNETV105 965#if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_TNETV105
948#define INCLUDE_TIMEOUT_API 966#define INCLUDE_TIMEOUT_API
949#define USB_DRIVER_CLOSE 967#define USB_DRIVER_CLOSE
950#endif 968#endif
969
951#if CONFIG_CPU == X1000 970#if CONFIG_CPU == X1000
952#define USB_DRIVER_CLOSE 971#define USB_DRIVER_CLOSE
953#endif 972#endif
954#endif 973
974#endif /* BOOTLOADER_USB_MODE */
955 975
956#else /* !BOOTLOADER */ 976#else /* !BOOTLOADER */
957 977
958#define HAVE_EXTENDED_MESSAGING_AND_NAME 978#define HAVE_EXTENDED_MESSAGING_AND_NAME
959#define HAVE_WAKEUP_EXT_CB 979#define HAVE_WAKEUP_EXT_CB
960 980
961
962#if defined(ASSEMBLER_THREADS) \ 981#if defined(ASSEMBLER_THREADS) \
963 || defined(HAVE_WIN32_FIBER_THREADS) \ 982 || defined(HAVE_WIN32_FIBER_THREADS) \
964 || defined(HAVE_SIGALTSTACK_THREADS) 983 || defined(HAVE_SIGALTSTACK_THREADS)
@@ -993,7 +1012,7 @@ Lyre prototype 1 */
993#endif /* CONFIG_USB == */ 1012#endif /* CONFIG_USB == */
994#endif /* HAVE_USBSTACK */ 1013#endif /* HAVE_USBSTACK */
995 1014
996#endif /* BOOTLOADER */ 1015#endif /* !BOOTLOADER */
997 1016
998#if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) || (CONFIG_CPU == JZ4760B) \ 1017#if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) || (CONFIG_CPU == JZ4760B) \
999 || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) \ 1018 || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) \
diff --git a/firmware/export/config/cowond2.h b/firmware/export/config/cowond2.h
index 5912fb63eb..fbfcc2c089 100644
--- a/firmware/export/config/cowond2.h
+++ b/firmware/export/config/cowond2.h
@@ -61,9 +61,8 @@
61/* NAND is broken. */ 61/* NAND is broken. */
62//#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD) 62//#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD)
63#define CONFIG_STORAGE STORAGE_SD 63#define CONFIG_STORAGE STORAGE_SD
64#define HAVE_MULTIDRIVE 64#define HAVE_MULTIVOLUME
65#define HAVE_HOTSWAP 65#define HAVE_HOTSWAP
66#define NUM_DRIVES 1
67 66
68#define CONFIG_NAND NAND_TCC 67#define CONFIG_NAND NAND_TCC
69 68
diff --git a/firmware/export/config/creativezen.h b/firmware/export/config/creativezen.h
index b1f438c354..d70749e59f 100644
--- a/firmware/export/config/creativezen.h
+++ b/firmware/export/config/creativezen.h
@@ -133,7 +133,6 @@
133#define CONFIG_STORAGE STORAGE_SD 133#define CONFIG_STORAGE STORAGE_SD
134#define NUM_DRIVES 2 134#define NUM_DRIVES 2
135#define HAVE_MULTIDRIVE 135#define HAVE_MULTIDRIVE
136#define HAVE_MULTIVOLUME
137#define HAVE_HOTSWAP 136#define HAVE_HOTSWAP
138 137
139/* todo */ 138/* todo */
diff --git a/firmware/export/config/creativezenxfi.h b/firmware/export/config/creativezenxfi.h
index 34cde37d9a..489dea80b7 100644
--- a/firmware/export/config/creativezenxfi.h
+++ b/firmware/export/config/creativezenxfi.h
@@ -138,7 +138,6 @@
138#define CONFIG_STORAGE STORAGE_SD 138#define CONFIG_STORAGE STORAGE_SD
139#define NUM_DRIVES 2 139#define NUM_DRIVES 2
140#define HAVE_MULTIDRIVE 140#define HAVE_MULTIDRIVE
141#define HAVE_MULTIVOLUME
142#define HAVE_HOTSWAP 141#define HAVE_HOTSWAP
143 142
144/* todo */ 143/* todo */
diff --git a/firmware/export/config/creativezenxfi2.h b/firmware/export/config/creativezenxfi2.h
index 47a600e8f5..5db228e559 100644
--- a/firmware/export/config/creativezenxfi2.h
+++ b/firmware/export/config/creativezenxfi2.h
@@ -140,7 +140,6 @@
140#define CONFIG_STORAGE (/*STORAGE_NAND |*/ STORAGE_SD) 140#define CONFIG_STORAGE (/*STORAGE_NAND |*/ STORAGE_SD)
141#define NUM_DRIVES 2 141#define NUM_DRIVES 2
142#define HAVE_MULTIDRIVE 142#define HAVE_MULTIDRIVE
143#define HAVE_MULTIVOLUME
144#define HAVE_HOTSWAP_STORAGE_AS_MAIN 143#define HAVE_HOTSWAP_STORAGE_AS_MAIN
145#define HAVE_HOTSWAP 144#define HAVE_HOTSWAP
146#define CONFIG_NAND NAND_IMX233 145#define CONFIG_NAND NAND_IMX233
diff --git a/firmware/export/config/creativezenxfi3.h b/firmware/export/config/creativezenxfi3.h
index a558c2a7df..5ff5d889c7 100644
--- a/firmware/export/config/creativezenxfi3.h
+++ b/firmware/export/config/creativezenxfi3.h
@@ -144,7 +144,6 @@
144#define CONFIG_STORAGE STORAGE_SD 144#define CONFIG_STORAGE STORAGE_SD
145#define NUM_DRIVES 2 145#define NUM_DRIVES 2
146#define HAVE_MULTIDRIVE 146#define HAVE_MULTIDRIVE
147#define HAVE_MULTIVOLUME
148#define HAVE_HOTSWAP 147#define HAVE_HOTSWAP
149 148
150/* Extra threads: touchpad */ 149/* Extra threads: touchpad */
diff --git a/firmware/export/config/erosqnative.h b/firmware/export/config/erosqnative.h
index f6e5b0d55e..26073a5f34 100644
--- a/firmware/export/config/erosqnative.h
+++ b/firmware/export/config/erosqnative.h
@@ -77,9 +77,7 @@
77#define CONFIG_STORAGE STORAGE_SD 77#define CONFIG_STORAGE STORAGE_SD
78#define HAVE_HOTSWAP 78#define HAVE_HOTSWAP
79#define HAVE_HOTSWAP_STORAGE_AS_MAIN 79#define HAVE_HOTSWAP_STORAGE_AS_MAIN
80#define HAVE_MULTIDRIVE
81#define HAVE_MULTIVOLUME 80#define HAVE_MULTIVOLUME
82#define NUM_DRIVES 1
83#define STORAGE_WANTS_ALIGN 81#define STORAGE_WANTS_ALIGN
84#define STORAGE_NEEDS_BOUNCE_BUFFER 82#define STORAGE_NEEDS_BOUNCE_BUFFER
85 83
diff --git a/firmware/export/config/fiiom3k.h b/firmware/export/config/fiiom3k.h
index cf8509405f..a5e32af2a0 100644
--- a/firmware/export/config/fiiom3k.h
+++ b/firmware/export/config/fiiom3k.h
@@ -81,9 +81,7 @@
81#define CONFIG_STORAGE STORAGE_SD 81#define CONFIG_STORAGE STORAGE_SD
82#define HAVE_HOTSWAP 82#define HAVE_HOTSWAP
83#define HAVE_HOTSWAP_STORAGE_AS_MAIN 83#define HAVE_HOTSWAP_STORAGE_AS_MAIN
84#define HAVE_MULTIDRIVE
85#define HAVE_MULTIVOLUME 84#define HAVE_MULTIVOLUME
86#define NUM_DRIVES 1
87#define STORAGE_WANTS_ALIGN 85#define STORAGE_WANTS_ALIGN
88#define STORAGE_NEEDS_BOUNCE_BUFFER 86#define STORAGE_NEEDS_BOUNCE_BUFFER
89 87
diff --git a/firmware/export/config/ihifi760.h b/firmware/export/config/ihifi760.h
index cc4152f5d8..ca62948bd2 100644
--- a/firmware/export/config/ihifi760.h
+++ b/firmware/export/config/ihifi760.h
@@ -49,6 +49,7 @@
49#define HAVE_FLASH_STORAGE 49#define HAVE_FLASH_STORAGE
50 50
51#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND) 51#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
52#define NUM_DRIVES 1 /* NAND doesn't work yet */
52 53
53#define CONFIG_NAND NAND_RK27XX 54#define CONFIG_NAND NAND_RK27XX
54#define HAVE_SW_TONE_CONTROLS 55#define HAVE_SW_TONE_CONTROLS
@@ -57,8 +58,6 @@
57 58
58/* commented for now */ 59/* commented for now */
59/* #define HAVE_HOTSWAP */ 60/* #define HAVE_HOTSWAP */
60
61#define NUM_DRIVES 1
62#define SECTOR_SIZE 512 61#define SECTOR_SIZE 512
63 62
64/* for small(ish) SD cards */ 63/* for small(ish) SD cards */
diff --git a/firmware/export/config/ihifi770.h b/firmware/export/config/ihifi770.h
index 74b12de994..68f6c71b90 100644
--- a/firmware/export/config/ihifi770.h
+++ b/firmware/export/config/ihifi770.h
@@ -50,13 +50,13 @@
50#define HAVE_FLASH_STORAGE 50#define HAVE_FLASH_STORAGE
51 51
52#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND) 52#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
53#define NUM_DRIVES 1 /* NAND doesn't work yet */
53 54
54#define CONFIG_NAND NAND_RK27XX 55#define CONFIG_NAND NAND_RK27XX
55#define HAVE_SW_TONE_CONTROLS 56#define HAVE_SW_TONE_CONTROLS
56 57
57#define HAVE_HOTSWAP 58// #define HAVE_HOTSWAP
58 59
59#define NUM_DRIVES 1
60#define SECTOR_SIZE 512 60#define SECTOR_SIZE 512
61 61
62/* for small(ish) SD cards */ 62/* for small(ish) SD cards */
@@ -183,7 +183,4 @@
183#define BOOTFILE "rockbox." BOOTFILE_EXT 183#define BOOTFILE "rockbox." BOOTFILE_EXT
184#define BOOTDIR "/.rockbox" 184#define BOOTDIR "/.rockbox"
185 185
186/* disabled for now */
187#undef HAVE_HOTSWAP
188
189#endif /* SIMULATOR */ 186#endif /* SIMULATOR */
diff --git a/firmware/export/config/ihifi770c.h b/firmware/export/config/ihifi770c.h
index 8224e2f368..a34d1b85c2 100644
--- a/firmware/export/config/ihifi770c.h
+++ b/firmware/export/config/ihifi770c.h
@@ -50,13 +50,13 @@
50#define HAVE_FLASH_STORAGE 50#define HAVE_FLASH_STORAGE
51 51
52#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND) 52#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
53#define NUM_DRIVES 1 /* NAND doesn't work yet */
53 54
54#define CONFIG_NAND NAND_RK27XX 55#define CONFIG_NAND NAND_RK27XX
55#define HAVE_SW_TONE_CONTROLS 56#define HAVE_SW_TONE_CONTROLS
56 57
57#define HAVE_HOTSWAP 58// #define HAVE_HOTSWAP
58 59
59#define NUM_DRIVES 1
60#define SECTOR_SIZE 512 60#define SECTOR_SIZE 512
61 61
62/* for small(ish) SD cards */ 62/* for small(ish) SD cards */
@@ -183,7 +183,4 @@
183#define BOOTFILE "rockbox." BOOTFILE_EXT 183#define BOOTFILE "rockbox." BOOTFILE_EXT
184#define BOOTDIR "/.rockbox" 184#define BOOTDIR "/.rockbox"
185 185
186/* disabled for now */
187#undef HAVE_HOTSWAP
188
189#endif /* SIMULATOR */ 186#endif /* SIMULATOR */
diff --git a/firmware/export/config/ihifi800.h b/firmware/export/config/ihifi800.h
index 91981682c1..e0cd1e1161 100644
--- a/firmware/export/config/ihifi800.h
+++ b/firmware/export/config/ihifi800.h
@@ -50,13 +50,13 @@
50#define HAVE_FLASH_STORAGE 50#define HAVE_FLASH_STORAGE
51 51
52#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND) 52#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
53#define NUM_DRIVES 1 /* NAND doesn't work yet */
53 54
54#define CONFIG_NAND NAND_RK27XX 55#define CONFIG_NAND NAND_RK27XX
55#define HAVE_SW_TONE_CONTROLS 56#define HAVE_SW_TONE_CONTROLS
56 57
57#define HAVE_HOTSWAP 58//#define HAVE_HOTSWAP
58 59
59#define NUM_DRIVES 1
60#define SECTOR_SIZE 512 60#define SECTOR_SIZE 512
61 61
62/* for small(ish) SD cards */ 62/* for small(ish) SD cards */
@@ -184,7 +184,4 @@
184#define BOOTFILE "rockbox." BOOTFILE_EXT 184#define BOOTFILE "rockbox." BOOTFILE_EXT
185#define BOOTDIR "/.rockbox" 185#define BOOTDIR "/.rockbox"
186 186
187/* disabled for now */
188#undef HAVE_HOTSWAP
189
190#endif /* SIMULATOR */ 187#endif /* SIMULATOR */
diff --git a/firmware/export/config/ihifi960.h b/firmware/export/config/ihifi960.h
index 64c6c90874..c0af676f28 100644
--- a/firmware/export/config/ihifi960.h
+++ b/firmware/export/config/ihifi960.h
@@ -49,6 +49,7 @@
49#define HAVE_FLASH_STORAGE 49#define HAVE_FLASH_STORAGE
50 50
51#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND) 51#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
52#define NUM_DRIVES 1 /* NAND doesn't work yet */
52 53
53#define CONFIG_NAND NAND_RK27XX 54#define CONFIG_NAND NAND_RK27XX
54#define HAVE_SW_TONE_CONTROLS 55#define HAVE_SW_TONE_CONTROLS
@@ -58,7 +59,6 @@
58/* commented for now */ 59/* commented for now */
59/* #define HAVE_HOTSWAP */ 60/* #define HAVE_HOTSWAP */
60 61
61#define NUM_DRIVES 1
62#define SECTOR_SIZE 512 62#define SECTOR_SIZE 512
63 63
64/* for small(ish) SD cards */ 64/* for small(ish) SD cards */
diff --git a/firmware/export/config/mini2440.h b/firmware/export/config/mini2440.h
index 4fc483b324..4149835eec 100644
--- a/firmware/export/config/mini2440.h
+++ b/firmware/export/config/mini2440.h
@@ -38,8 +38,7 @@
38/* define the storage type */ 38/* define the storage type */
39#define CONFIG_STORAGE STORAGE_SD 39#define CONFIG_STORAGE STORAGE_SD
40 40
41#define HAVE_MULTIDRIVE 41#define HAVE_MULTIVOLUME
42#define NUM_DRIVES 1 // no access to NAND yet
43#define HAVE_HOTSWAP 42#define HAVE_HOTSWAP
44#define HAVE_HOTSWAP_STORAGE_AS_MAIN 43#define HAVE_HOTSWAP_STORAGE_AS_MAIN
45#define INCLUDE_TIMEOUT_API 44#define INCLUDE_TIMEOUT_API
diff --git a/firmware/export/config/ondavx747.h b/firmware/export/config/ondavx747.h
index 7f4f1ea843..a9d4f0fecf 100644
--- a/firmware/export/config/ondavx747.h
+++ b/firmware/export/config/ondavx747.h
@@ -161,11 +161,11 @@
161No access to the NAND yet.. 161No access to the NAND yet..
162 162
163#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD) 163#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD)
164#define HAVE_MULTIDRIVE
164#define NUM_DRIVES 2 165#define NUM_DRIVES 2
165*/ 166*/
166#define CONFIG_STORAGE (STORAGE_SD) 167#define CONFIG_STORAGE (STORAGE_SD)
167#define HAVE_MULTIDRIVE 168#define HAVE_MULTIVOLUME
168#define NUM_DRIVES 1
169#define HAVE_HOTSWAP_STORAGE_AS_MAIN 169#define HAVE_HOTSWAP_STORAGE_AS_MAIN
170#define INCLUDE_TIMEOUT_API 170#define INCLUDE_TIMEOUT_API
171 171
diff --git a/firmware/export/config/ondavx777.h b/firmware/export/config/ondavx777.h
index ceea151d8c..1387898eff 100644
--- a/firmware/export/config/ondavx777.h
+++ b/firmware/export/config/ondavx777.h
@@ -152,11 +152,11 @@
152No access to the NAND yet.. 152No access to the NAND yet..
153 153
154#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD) 154#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD)
155#define HAVE_MULTIDRIVE
155#define NUM_DRIVES 2 156#define NUM_DRIVES 2
156*/ 157*/
157#define CONFIG_STORAGE (STORAGE_SD) 158#define CONFIG_STORAGE (STORAGE_SD)
158#define HAVE_MULTIDRIVE 159#define HAVE_MULTIVOLUME
159#define NUM_DRIVES 1
160#define HAVE_HOTSWAP_STORAGE_AS_MAIN 160#define HAVE_HOTSWAP_STORAGE_AS_MAIN
161#define INCLUDE_TIMEOUT_API 161#define INCLUDE_TIMEOUT_API
162 162
diff --git a/firmware/export/config/rk27generic.h b/firmware/export/config/rk27generic.h
index 967fc6d8ff..23768c1d2e 100644
--- a/firmware/export/config/rk27generic.h
+++ b/firmware/export/config/rk27generic.h
@@ -56,6 +56,7 @@
56#define HAVE_FLASH_STORAGE 56#define HAVE_FLASH_STORAGE
57 57
58#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND) 58#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
59#define NUM_DRIVES 1 /* NAND doesn't work yet */
59 60
60#define CONFIG_NAND NAND_RK27XX 61#define CONFIG_NAND NAND_RK27XX
61#define HAVE_SW_TONE_CONTROLS 62#define HAVE_SW_TONE_CONTROLS
@@ -63,7 +64,6 @@
63/* commented for now */ 64/* commented for now */
64/* #define HAVE_HOTSWAP */ 65/* #define HAVE_HOTSWAP */
65 66
66#define NUM_DRIVES 1
67#define SECTOR_SIZE 512 67#define SECTOR_SIZE 512
68 68
69/* for small(ish) SD cards */ 69/* for small(ish) SD cards */
diff --git a/firmware/export/config/sansae200.h b/firmware/export/config/sansae200.h
index 1c10f74845..70782aa147 100644
--- a/firmware/export/config/sansae200.h
+++ b/firmware/export/config/sansae200.h
@@ -181,7 +181,6 @@
181#define CONFIG_LCD LCD_X5 181#define CONFIG_LCD LCD_X5
182 182
183#define HAVE_MULTIDRIVE 183#define HAVE_MULTIDRIVE
184//#define HAVE_MULTIVOLUME
185#define NUM_DRIVES 2 184#define NUM_DRIVES 2
186#define HAVE_HOTSWAP /* required to access sd from bootloader */ 185#define HAVE_HOTSWAP /* required to access sd from bootloader */
187 186
diff --git a/firmware/export/config/shanlingq1.h b/firmware/export/config/shanlingq1.h
index a708cfc2a9..4e74f9e33c 100644
--- a/firmware/export/config/shanlingq1.h
+++ b/firmware/export/config/shanlingq1.h
@@ -64,9 +64,7 @@
64#define CONFIG_STORAGE STORAGE_SD 64#define CONFIG_STORAGE STORAGE_SD
65#define HAVE_HOTSWAP 65#define HAVE_HOTSWAP
66#define HAVE_HOTSWAP_STORAGE_AS_MAIN 66#define HAVE_HOTSWAP_STORAGE_AS_MAIN
67#define HAVE_MULTIDRIVE
68#define HAVE_MULTIVOLUME 67#define HAVE_MULTIVOLUME
69#define NUM_DRIVES 1
70#define STORAGE_WANTS_ALIGN 68#define STORAGE_WANTS_ALIGN
71#define STORAGE_NEEDS_BOUNCE_BUFFER 69#define STORAGE_NEEDS_BOUNCE_BUFFER
72 70
diff --git a/firmware/export/config/xduoox3.h b/firmware/export/config/xduoox3.h
index 46e1a61712..0d413ad372 100644
--- a/firmware/export/config/xduoox3.h
+++ b/firmware/export/config/xduoox3.h
@@ -174,6 +174,7 @@
174/* Type of LCD */ 174/* Type of LCD */
175#define CONFIG_LCD LCD_XDUOOX3 175#define CONFIG_LCD LCD_XDUOOX3
176 176
177#ifndef BOOTLOADER
177/* USB On-the-go */ 178/* USB On-the-go */
178#define CONFIG_USBOTG USBOTG_JZ4760 179#define CONFIG_USBOTG USBOTG_JZ4760
179 180
@@ -189,6 +190,7 @@
189 190
190#define USB_NUM_ENDPOINTS 3 191#define USB_NUM_ENDPOINTS 3
191#define USB_DEVBSS_ATTR IBSS_ATTR 192#define USB_DEVBSS_ATTR IBSS_ATTR
193#endif /* !BOOTLOADER */
192 194
193#define BOOTFILE_EXT "x3" 195#define BOOTFILE_EXT "x3"
194#define BOOTFILE "rockbox." BOOTFILE_EXT 196#define BOOTFILE "rockbox." BOOTFILE_EXT
@@ -198,7 +200,7 @@
198 200
199#define ICODE_ATTR_TREMOR_NOT_MDCT 201#define ICODE_ATTR_TREMOR_NOT_MDCT
200 202
201#endif /* SIMULATOR */ 203#endif /* !SIMULATOR */
202 204
203/** Port-specific settings **/ 205/** Port-specific settings **/
204 206
diff --git a/firmware/export/disk.h b/firmware/export/disk.h
index e465552fdc..a19e011170 100644
--- a/firmware/export/disk.h
+++ b/firmware/export/disk.h
@@ -26,8 +26,8 @@
26 26
27struct partinfo 27struct partinfo
28{ 28{
29 unsigned long start; /* first sector (LBA) */ 29 sector_t start; /* first sector (LBA) */
30 unsigned long size; /* number of sectors */ 30 sector_t size; /* number of sectors */
31 unsigned char type; 31 unsigned char type;
32}; 32};
33 33
diff --git a/firmware/export/fat.h b/firmware/export/fat.h
index 70152985b5..7382d85ce4 100644
--- a/firmware/export/fat.h
+++ b/firmware/export/fat.h
@@ -115,7 +115,7 @@ struct fat_filestr
115{ 115{
116 struct fat_file *fatfilep; /* common file information */ 116 struct fat_file *fatfilep; /* common file information */
117 long lastcluster; /* cluster of last access */ 117 long lastcluster; /* cluster of last access */
118 unsigned long lastsector; /* sector of last access */ 118 sector_t lastsector; /* sector of last access */
119 long clusternum; /* cluster number of last access */ 119 long clusternum; /* cluster number of last access */
120 unsigned long sectornum; /* sector number within current cluster */ 120 unsigned long sectornum; /* sector number within current cluster */
121 bool eof; /* end-of-file reached */ 121 bool eof; /* end-of-file reached */
@@ -173,7 +173,7 @@ int fat_get_bytes_per_sector(IF_MV_NONVOID(int volume));
173#endif /* MAX_LOG_SECTOR_SIZE */ 173#endif /* MAX_LOG_SECTOR_SIZE */
174unsigned int fat_get_cluster_size(IF_MV_NONVOID(int volume)); 174unsigned int fat_get_cluster_size(IF_MV_NONVOID(int volume));
175void fat_recalc_free(IF_MV_NONVOID(int volume)); 175void fat_recalc_free(IF_MV_NONVOID(int volume));
176bool fat_size(IF_MV(int volume,) unsigned long *size, unsigned long *free); 176bool fat_size(IF_MV(int volume,) sector_t *size, sector_t *free);
177 177
178/** Misc. **/ 178/** Misc. **/
179void fat_empty_fat_direntry(struct fat_direntry *entry); 179void fat_empty_fat_direntry(struct fat_direntry *entry);
diff --git a/firmware/export/hostfs.h b/firmware/export/hostfs.h
index c0fe85236e..c59868110a 100644
--- a/firmware/export/hostfs.h
+++ b/firmware/export/hostfs.h
@@ -37,8 +37,8 @@ extern int hostfs_init(void);
37extern int hostfs_flush(void); 37extern int hostfs_flush(void);
38 38
39#ifdef HAVE_HOTSWAP 39#ifdef HAVE_HOTSWAP
40extern bool hostfs_removable(int drive); 40extern bool hostfs_removable(IF_MD_NONVOID(int drive));
41extern bool hostfs_present(int drive); 41extern bool hostfs_present(IF_MD_NONVOID(int drive));
42#endif 42#endif
43 43
44/* This has to be repeated here for now for sim's sake since HAVE_HOSTFS 44/* This has to be repeated here for now for sim's sake since HAVE_HOSTFS
diff --git a/firmware/export/mmc.h b/firmware/export/mmc.h
index 0d27e20a64..06df979b81 100644
--- a/firmware/export/mmc.h
+++ b/firmware/export/mmc.h
@@ -36,8 +36,8 @@ bool mmc_disk_is_active(void);
36int mmc_soft_reset(void); 36int mmc_soft_reset(void);
37int mmc_init(void) STORAGE_INIT_ATTR; 37int mmc_init(void) STORAGE_INIT_ATTR;
38void mmc_close(void); 38void mmc_close(void);
39int mmc_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); 39int mmc_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf);
40int mmc_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); 40int mmc_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf);
41void mmc_spin(void); 41void mmc_spin(void);
42int mmc_spinup_time(void); 42int mmc_spinup_time(void);
43 43
diff --git a/firmware/export/mv.h b/firmware/export/mv.h
index 966ff9a032..9d202a8087 100644
--- a/firmware/export/mv.h
+++ b/firmware/export/mv.h
@@ -23,6 +23,7 @@
23#define __MV_H__ 23#define __MV_H__
24 24
25#include <stdbool.h> 25#include <stdbool.h>
26#include <stdint.h>
26#include "config.h" 27#include "config.h"
27 28
28/* FixMe: These macros are a bit nasty and perhaps misplaced here. 29/* FixMe: These macros are a bit nasty and perhaps misplaced here.
@@ -40,6 +41,19 @@
40#define IF_MD_DRV(d) 0 41#define IF_MD_DRV(d) 0
41#endif /* HAVE_MULTIDRIVE */ 42#endif /* HAVE_MULTIDRIVE */
42 43
44/* Storage size */
45#if (CONFIG_STORAGE & STORAGE_ATA) && defined(HAVE_LBA48)
46typedef uint64_t sector_t;
47#define STORAGE_64BIT_SECTOR
48#elif (CONFIG_STORAGE & STORAGE_SD) && defined(HAVE_SDUC)
49typedef uint64_t sector_t;
50#define STORAGE_64BIT_SECTOR
51#else
52typedef unsigned long sector_t;
53#undef STORAGE_64BIT_SECTOR
54#endif
55
56
43/* Volumes mean things that have filesystems on them, like partitions */ 57/* Volumes mean things that have filesystems on them, like partitions */
44#ifdef HAVE_MULTIVOLUME 58#ifdef HAVE_MULTIVOLUME
45#define IF_MV(x...) x /* valist contents or empty */ 59#define IF_MV(x...) x /* valist contents or empty */
@@ -113,13 +127,16 @@ struct volumeinfo
113/* Volume-centric functions (in disk.c) */ 127/* Volume-centric functions (in disk.c) */
114void volume_recalc_free(IF_MV_NONVOID(int volume)); 128void volume_recalc_free(IF_MV_NONVOID(int volume));
115unsigned int volume_get_cluster_size(IF_MV_NONVOID(int volume)); 129unsigned int volume_get_cluster_size(IF_MV_NONVOID(int volume));
116void volume_size(IF_MV(int volume,) unsigned long *size, unsigned long *free); 130void volume_size(IF_MV(int volume,) sector_t *size, sector_t *free);
117#ifdef HAVE_DIRCACHE 131#ifdef HAVE_DIRCACHE
118bool volume_ismounted(IF_MV_NONVOID(int volume)); 132bool volume_ismounted(IF_MV_NONVOID(int volume));
119#endif 133#endif
120#ifdef HAVE_HOTSWAP 134#ifdef HAVE_HOTSWAP
121bool volume_removable(int volume); 135bool volume_removable(int volume);
122bool volume_present(int volume); 136bool volume_present(int volume);
137#else
138#define volume_present(x) 1
139#define volueme_removeable(x) 0
123#endif /* HAVE_HOTSWAP */ 140#endif /* HAVE_HOTSWAP */
124 141
125#ifdef HAVE_MULTIDRIVE 142#ifdef HAVE_MULTIDRIVE
diff --git a/firmware/export/nand.h b/firmware/export/nand.h
index fe25c9b407..d4fd6028ed 100644
--- a/firmware/export/nand.h
+++ b/firmware/export/nand.h
@@ -36,8 +36,8 @@ bool nand_disk_is_active(void);
36int nand_soft_reset(void); 36int nand_soft_reset(void);
37int nand_init(void) STORAGE_INIT_ATTR; 37int nand_init(void) STORAGE_INIT_ATTR;
38void nand_close(void); 38void nand_close(void);
39int nand_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); 39int nand_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf);
40int nand_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); 40int nand_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf);
41#ifdef HAVE_STORAGE_FLUSH 41#ifdef HAVE_STORAGE_FLUSH
42int nand_flush(void); 42int nand_flush(void);
43#endif 43#endif
diff --git a/firmware/export/pathfuncs.h b/firmware/export/pathfuncs.h
index 1b18f22d06..fce8e5851c 100644
--- a/firmware/export/pathfuncs.h
+++ b/firmware/export/pathfuncs.h
@@ -82,6 +82,8 @@ int path_strip_volume(const char *name, const char **nameptr, bool greedy);
82int path_strip_last_volume(const char *name, const char **nameptr, bool greedy); 82int path_strip_last_volume(const char *name, const char **nameptr, bool greedy);
83int get_volume_name(int volume, char *name); 83int get_volume_name(int volume, char *name);
84int make_volume_root(int volume, char *dst); 84int make_volume_root(int volume, char *dst);
85void init_volume_names(void);
86int path_get_volume_id(const char *name);
85#endif 87#endif
86 88
87int path_strip_drive(const char *name, const char **nameptr, bool greedy); 89int path_strip_drive(const char *name, const char **nameptr, bool greedy);
diff --git a/firmware/export/ramdisk.h b/firmware/export/ramdisk.h
index d79ac50836..eb06ea9650 100644
--- a/firmware/export/ramdisk.h
+++ b/firmware/export/ramdisk.h
@@ -35,8 +35,8 @@ bool ramdisk_disk_is_active(void);
35int ramdisk_soft_reset(void); 35int ramdisk_soft_reset(void);
36int ramdisk_init(void) STORAGE_INIT_ATTR; 36int ramdisk_init(void) STORAGE_INIT_ATTR;
37void ramdisk_close(void); 37void ramdisk_close(void);
38int ramdisk_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); 38int ramdisk_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf);
39int ramdisk_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); 39int ramdisk_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf);
40void ramdisk_spin(void); 40void ramdisk_spin(void);
41void ramdisk_sleepnow(void); 41void ramdisk_sleepnow(void);
42int ramdisk_spinup_time(void); 42int ramdisk_spinup_time(void);
diff --git a/firmware/export/rbpaths.h b/firmware/export/rbpaths.h
index 9dd0a24c6f..2376163180 100644
--- a/firmware/export/rbpaths.h
+++ b/firmware/export/rbpaths.h
@@ -54,6 +54,8 @@
54 54
55#define RB_ROOT_VOL_HIDDEN(v) (IF_MV_VOL(v) == 0) 55#define RB_ROOT_VOL_HIDDEN(v) (IF_MV_VOL(v) == 0)
56#define RB_ROOT_CONTENTS_DIR "/" IF_MV("<0>") 56#define RB_ROOT_CONTENTS_DIR "/" IF_MV("<0>")
57#define REC_BASE_DIR HOME_DIR "Recordings"
58#define PLAYLIST_CATALOG_DEFAULT_DIR HOME_DIR "Playlists"
57 59
58#else /* APPLICATION */ 60#else /* APPLICATION */
59 61
@@ -67,13 +69,11 @@
67#define CODECS_DIR ROCKBOX_LIBRARY_PATH "/rockbox/codecs" 69#define CODECS_DIR ROCKBOX_LIBRARY_PATH "/rockbox/codecs"
68#endif 70#endif
69 71
70#endif /* !APPLICATION || SAMSUNG_YPR0 */
71
72#define REC_BASE_DIR HOME_DIR "/Recordings" 72#define REC_BASE_DIR HOME_DIR "/Recordings"
73#define PLAYLIST_CATALOG_DEFAULT_DIR HOME_DIR "/Playlists" 73#define PLAYLIST_CATALOG_DEFAULT_DIR HOME_DIR "/Playlists"
74#endif /* !APPLICATION || SAMSUNG_YPR0 */
74 75
75#define LANG_DIR ROCKBOX_DIR "/langs" 76#define LANG_DIR ROCKBOX_DIR "/langs"
76
77#define PLUGIN_GAMES_DIR PLUGIN_DIR "/games" 77#define PLUGIN_GAMES_DIR PLUGIN_DIR "/games"
78#define PLUGIN_APPS_DIR PLUGIN_DIR "/apps" 78#define PLUGIN_APPS_DIR PLUGIN_DIR "/apps"
79#define PLUGIN_DEMOS_DIR PLUGIN_DIR "/demos" 79#define PLUGIN_DEMOS_DIR PLUGIN_DIR "/demos"
diff --git a/firmware/export/sd.h b/firmware/export/sd.h
index c657f8a545..d66e6f899c 100644
--- a/firmware/export/sd.h
+++ b/firmware/export/sd.h
@@ -42,8 +42,8 @@ bool sd_disk_is_active(void);
42int sd_soft_reset(void); 42int sd_soft_reset(void);
43int sd_init(void) STORAGE_INIT_ATTR; 43int sd_init(void) STORAGE_INIT_ATTR;
44void sd_close(void); 44void sd_close(void);
45int sd_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); 45int sd_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf);
46int sd_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); 46int sd_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf);
47void sd_spin(void); 47void sd_spin(void);
48int sd_spinup_time(void); /* ticks */ 48int sd_spinup_time(void); /* ticks */
49 49
@@ -93,6 +93,7 @@ int sd_num_drives(int first_drive);
93#define SD_READ_SINGLE_BLOCK 17 93#define SD_READ_SINGLE_BLOCK 17
94#define SD_READ_MULTIPLE_BLOCK 18 94#define SD_READ_MULTIPLE_BLOCK 18
95#define SD_SEND_NUM_WR_BLOCKS 22 /* acmd22 */ 95#define SD_SEND_NUM_WR_BLOCKS 22 /* acmd22 */
96#define SD_UC_ADDRESS_EXTENSION 22
96#define SD_SET_WR_BLK_ERASE_COUNT 23 /* acmd23 */ 97#define SD_SET_WR_BLK_ERASE_COUNT 23 /* acmd23 */
97#define SD_WRITE_BLOCK 24 98#define SD_WRITE_BLOCK 24
98#define SD_WRITE_MULTIPLE_BLOCK 25 99#define SD_WRITE_MULTIPLE_BLOCK 25
diff --git a/firmware/export/sdmmc.h b/firmware/export/sdmmc.h
index 35539169d9..f84a7b96fa 100644
--- a/firmware/export/sdmmc.h
+++ b/firmware/export/sdmmc.h
@@ -22,9 +22,11 @@
22#define __SDMMC_H__ 22#define __SDMMC_H__
23 23
24#include <stdbool.h> 24#include <stdbool.h>
25#include <stdint.h>
26#include <mv.h> /* for sector_t */
25 27
26typedef struct 28typedef struct
27{ 29{
28 bool initialized; 30 bool initialized;
29 31
30 unsigned long read_timeout; /* n * 8 clock cycles */ 32 unsigned long read_timeout; /* n * 8 clock cycles */
@@ -37,7 +39,7 @@ typedef struct
37 unsigned int nsac; /* clock cycles */ 39 unsigned int nsac; /* clock cycles */
38 unsigned long taac; /* n * 0.1 ns */ 40 unsigned long taac; /* n * 0.1 ns */
39 unsigned int r2w_factor; 41 unsigned int r2w_factor;
40 unsigned long numblocks; /* size in flash blocks */ 42 sector_t numblocks; /* size in flash blocks */
41 unsigned int blocksize; /* block size in bytes */ 43 unsigned int blocksize; /* block size in bytes */
42 unsigned long rca; /* RCA register */ 44 unsigned long rca; /* RCA register */
43 45
@@ -48,6 +50,8 @@ typedef struct
48#if (CONFIG_STORAGE & STORAGE_SD) 50#if (CONFIG_STORAGE & STORAGE_SD)
49 unsigned int current_bank; 51 unsigned int current_bank;
50#endif 52#endif
53
54 unsigned int sd2plus; /* SD 2.0 or better */
51} tCardInfo; 55} tCardInfo;
52 56
53#if (CONFIG_STORAGE & STORAGE_SD) 57#if (CONFIG_STORAGE & STORAGE_SD)
diff --git a/firmware/export/storage.h b/firmware/export/storage.h
index ee1423c93a..e2ae4056be 100644
--- a/firmware/export/storage.h
+++ b/firmware/export/storage.h
@@ -107,7 +107,7 @@ int ramdisk_event(long id, intptr_t data);
107struct storage_info 107struct storage_info
108{ 108{
109 unsigned int sector_size; 109 unsigned int sector_size;
110 unsigned int num_sectors; 110 sector_t num_sectors;
111 char *vendor; 111 char *vendor;
112 char *product; 112 char *product;
113 char *revision; 113 char *revision;
@@ -227,7 +227,7 @@ static inline void storage_sleep(void) {};
227 #define storage_last_disk_activity() mmc_last_disk_activity() 227 #define storage_last_disk_activity() mmc_last_disk_activity()
228 #define storage_spinup_time() 0 228 #define storage_spinup_time() 0
229 #define storage_get_identify() mmc_get_identify() 229 #define storage_get_identify() mmc_get_identify()
230 230
231 #ifdef STORAGE_GET_INFO 231 #ifdef STORAGE_GET_INFO
232 #define storage_get_info(drive, info) mmc_get_info(IF_MD(drive,) info) 232 #define storage_get_info(drive, info) mmc_get_info(IF_MD(drive,) info)
233 #endif 233 #endif
@@ -251,7 +251,7 @@ static inline void storage_sleep(void) {};
251 #define storage_last_disk_activity() nand_last_disk_activity() 251 #define storage_last_disk_activity() nand_last_disk_activity()
252 #define storage_spinup_time() 0 252 #define storage_spinup_time() 0
253 #define storage_get_identify() nand_get_identify() 253 #define storage_get_identify() nand_get_identify()
254 254
255 #ifdef STORAGE_GET_INFO 255 #ifdef STORAGE_GET_INFO
256 #define storage_get_info(drive, info) nand_get_info(IF_MD(drive,) info) 256 #define storage_get_info(drive, info) nand_get_info(IF_MD(drive,) info)
257 #endif 257 #endif
@@ -275,7 +275,7 @@ static inline void storage_sleep(void) {};
275 #define storage_last_disk_activity() ramdisk_last_disk_activity() 275 #define storage_last_disk_activity() ramdisk_last_disk_activity()
276 #define storage_spinup_time() 0 276 #define storage_spinup_time() 0
277 #define storage_get_identify() ramdisk_get_identify() 277 #define storage_get_identify() ramdisk_get_identify()
278 278
279 #ifdef STORAGE_GET_INFO 279 #ifdef STORAGE_GET_INFO
280 #define storage_get_info(drive, info) ramdisk_get_info(IF_MD(drive,) info) 280 #define storage_get_info(drive, info) ramdisk_get_info(IF_MD(drive,) info)
281 #endif 281 #endif
@@ -310,11 +310,14 @@ void storage_get_info(int drive, struct storage_info *info);
310#ifdef HAVE_HOTSWAP 310#ifdef HAVE_HOTSWAP
311bool storage_removable(int drive); 311bool storage_removable(int drive);
312bool storage_present(int drive); 312bool storage_present(int drive);
313#else
314#define storage_removable(x) 0
315#define storage_present(x) 1
313#endif 316#endif
314int storage_driver_type(int drive); 317int storage_driver_type(int drive);
315 318
316#endif /* NOT CONFIG_STORAGE_MULTI and NOT SIMULATOR*/ 319#endif /* NOT CONFIG_STORAGE_MULTI and NOT SIMULATOR*/
317 320
318int storage_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); 321int storage_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf);
319int storage_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); 322int storage_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf);
320#endif 323#endif