diff options
Diffstat (limited to 'firmware/export')
33 files changed, 236 insertions, 89 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); | |||
140 | int ata_soft_reset(void); | 140 | int ata_soft_reset(void); |
141 | int ata_init(void) STORAGE_INIT_ATTR; | 141 | int ata_init(void) STORAGE_INIT_ATTR; |
142 | void ata_close(void); | 142 | void ata_close(void); |
143 | int ata_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); | 143 | int ata_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf); |
144 | int ata_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); | 144 | int ata_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf); |
145 | void ata_spin(void); | 145 | void ata_spin(void); |
146 | #if (CONFIG_LED == LED_REAL) | 146 | #if (CONFIG_LED == LED_REAL) |
147 | void ata_set_led_enabled(bool enabled); | 147 | void 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..bedf7df4e2 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -635,6 +635,12 @@ Lyre prototype 1 */ | |||
635 | #endif | 635 | #endif |
636 | #endif | 636 | #endif |
637 | 637 | ||
638 | #if defined(__PCTOOL__) || defined(SIMULATOR) | ||
639 | #ifndef CONFIG_PLATFORM | ||
640 | #define CONFIG_PLATFORM PLATFORM_HOSTED | ||
641 | #endif | ||
642 | #endif | ||
643 | |||
638 | #ifndef CONFIG_PLATFORM | 644 | #ifndef CONFIG_PLATFORM |
639 | #define CONFIG_PLATFORM PLATFORM_NATIVE | 645 | #define CONFIG_PLATFORM PLATFORM_NATIVE |
640 | #endif | 646 | #endif |
@@ -868,22 +874,41 @@ Lyre prototype 1 */ | |||
868 | #define CONFIG_STORAGE_MULTI | 874 | #define CONFIG_STORAGE_MULTI |
869 | #endif | 875 | #endif |
870 | 876 | ||
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) | 877 | #if defined(CONFIG_STORAGE_MULTI) && !defined(HAVE_MULTIDRIVE) |
878 | #define HAVE_MULTIDRIVE | 878 | #define HAVE_MULTIDRIVE |
879 | #endif | 879 | #endif |
880 | 880 | ||
881 | #if defined(HAVE_MULTIDRIVE) && !defined(HAVE_MULTIVOLUME) | 881 | #if defined(HAVE_MULTIDRIVE) && !defined(NUM_DRIVES) |
882 | #error HAVE_MULTIDRIVE needs to have an explicit NUM_DRIVES | ||
883 | #endif | ||
884 | |||
885 | #ifndef NUM_DRIVES | ||
886 | #define NUM_DRIVES 1 | ||
887 | #endif | ||
888 | |||
889 | #if !defined(HAVE_MULTIVOLUME) | ||
890 | #if defined(HAVE_MULTIDRIVE) | ||
891 | /* Multidrive strongly implies multivolume */ | ||
882 | #define HAVE_MULTIVOLUME | 892 | #define HAVE_MULTIVOLUME |
893 | #elif (CONFIG_STORAGE & STORAGE_SD) | ||
894 | /* SD routinely have multiple partitions */ | ||
895 | #elif (CONFIG_STORAGE & STORAGE_ATA) && defined(HAVE_LBA48) | ||
896 | /* ATA routinely haves multiple partitions, but don't bother if we can't do LBA48 */ | ||
897 | #define HAVE_MULTIVOLUME | ||
898 | #endif | ||
883 | #endif | 899 | #endif |
884 | 900 | ||
885 | #if defined(HAVE_MULTIDRIVE) && !defined(NUM_DRIVES) | 901 | /* Bootloaders don't need multivolume awareness */ |
886 | #error HAVE_MULTIDRIVE needs to have an explicit NUM_DRIVES | 902 | #if defined(BOOTLOADER) && defined(HAVE_MULTIVOLUME) \ |
903 | && !(CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(BOOT_REDIR) | ||
904 | #undef HAVE_MULTIVOLUME | ||
905 | #endif | ||
906 | |||
907 | /* Number of volumes per drive */ | ||
908 | #if defined(HAVE_MULTIVOLUME) && !defined(SIMULATOR) && !(CONFIG_PLATFORM & PLATFORM_HOSTED) | ||
909 | #define NUM_VOLUMES_PER_DRIVE 4 | ||
910 | #else | ||
911 | #define NUM_VOLUMES_PER_DRIVE 1 | ||
887 | #endif | 912 | #endif |
888 | 913 | ||
889 | /* note to remove multi-partition booting this could be changed to MULTIDRIVE */ | 914 | /* note to remove multi-partition booting this could be changed to MULTIDRIVE */ |
@@ -897,10 +922,6 @@ Lyre prototype 1 */ | |||
897 | # define MULTIBOOT_MIN_VOLUME 0 | 922 | # define MULTIBOOT_MIN_VOLUME 0 |
898 | #endif | 923 | #endif |
899 | 924 | ||
900 | #ifndef NUM_DRIVES | ||
901 | #define NUM_DRIVES 1 | ||
902 | #endif | ||
903 | |||
904 | #define NUM_VOLUMES (NUM_DRIVES * NUM_VOLUMES_PER_DRIVE) | 925 | #define NUM_VOLUMES (NUM_DRIVES * NUM_VOLUMES_PER_DRIVE) |
905 | 926 | ||
906 | #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ) | 927 | #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ) |
@@ -934,31 +955,35 @@ Lyre prototype 1 */ | |||
934 | #ifdef HAVE_BOOTLOADER_USB_MODE | 955 | #ifdef HAVE_BOOTLOADER_USB_MODE |
935 | /* Priority in bootloader is wanted */ | 956 | /* Priority in bootloader is wanted */ |
936 | #define HAVE_PRIORITY_SCHEDULING | 957 | #define HAVE_PRIORITY_SCHEDULING |
958 | |||
937 | #if (CONFIG_CPU == S5L8702) | 959 | #if (CONFIG_CPU == S5L8702) |
938 | #define USB_DRIVER_CLOSE | 960 | #define USB_DRIVER_CLOSE |
939 | #else | 961 | #else |
940 | #define USB_STATUS_BY_EVENT | 962 | #define USB_STATUS_BY_EVENT |
941 | #define USB_DETECT_BY_REQUEST | 963 | #define USB_DETECT_BY_REQUEST |
942 | #endif | 964 | #endif |
965 | |||
943 | #if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC | 966 | #if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC |
944 | #define INCLUDE_TIMEOUT_API | 967 | #define INCLUDE_TIMEOUT_API |
945 | #define USB_DRIVER_CLOSE | 968 | #define USB_DRIVER_CLOSE |
946 | #endif | 969 | #endif |
970 | |||
947 | #if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_TNETV105 | 971 | #if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_TNETV105 |
948 | #define INCLUDE_TIMEOUT_API | 972 | #define INCLUDE_TIMEOUT_API |
949 | #define USB_DRIVER_CLOSE | 973 | #define USB_DRIVER_CLOSE |
950 | #endif | 974 | #endif |
975 | |||
951 | #if CONFIG_CPU == X1000 | 976 | #if CONFIG_CPU == X1000 |
952 | #define USB_DRIVER_CLOSE | 977 | #define USB_DRIVER_CLOSE |
953 | #endif | 978 | #endif |
954 | #endif | 979 | |
980 | #endif /* BOOTLOADER_USB_MODE */ | ||
955 | 981 | ||
956 | #else /* !BOOTLOADER */ | 982 | #else /* !BOOTLOADER */ |
957 | 983 | ||
958 | #define HAVE_EXTENDED_MESSAGING_AND_NAME | 984 | #define HAVE_EXTENDED_MESSAGING_AND_NAME |
959 | #define HAVE_WAKEUP_EXT_CB | 985 | #define HAVE_WAKEUP_EXT_CB |
960 | 986 | ||
961 | |||
962 | #if defined(ASSEMBLER_THREADS) \ | 987 | #if defined(ASSEMBLER_THREADS) \ |
963 | || defined(HAVE_WIN32_FIBER_THREADS) \ | 988 | || defined(HAVE_WIN32_FIBER_THREADS) \ |
964 | || defined(HAVE_SIGALTSTACK_THREADS) | 989 | || defined(HAVE_SIGALTSTACK_THREADS) |
@@ -993,7 +1018,7 @@ Lyre prototype 1 */ | |||
993 | #endif /* CONFIG_USB == */ | 1018 | #endif /* CONFIG_USB == */ |
994 | #endif /* HAVE_USBSTACK */ | 1019 | #endif /* HAVE_USBSTACK */ |
995 | 1020 | ||
996 | #endif /* BOOTLOADER */ | 1021 | #endif /* !BOOTLOADER */ |
997 | 1022 | ||
998 | #if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) || (CONFIG_CPU == JZ4760B) \ | 1023 | #if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) || (CONFIG_CPU == JZ4760B) \ |
999 | || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) \ | 1024 | || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) \ |
@@ -1240,6 +1265,12 @@ Lyre prototype 1 */ | |||
1240 | #endif | 1265 | #endif |
1241 | #endif | 1266 | #endif |
1242 | 1267 | ||
1268 | #if defined(HAVE_SIGALTSTACK_THREADS) | ||
1269 | #ifndef _XOPEN_SOURCE | ||
1270 | #define _XOPEN_SOURCE 600 /* For sigaltstack */ | ||
1271 | #endif | ||
1272 | #endif | ||
1273 | |||
1243 | #ifdef CPU_MIPS | 1274 | #ifdef CPU_MIPS |
1244 | #include <stdbool.h> /* MIPS GCC fix? */ | 1275 | #include <stdbool.h> /* MIPS GCC fix? */ |
1245 | #endif | 1276 | #endif |
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..adb1b29e01 100644 --- a/firmware/export/config/erosqnative.h +++ b/firmware/export/config/erosqnative.h | |||
@@ -9,6 +9,19 @@ | |||
9 | #define BOOTFILE "rockbox." BOOTFILE_EXT | 9 | #define BOOTFILE "rockbox." BOOTFILE_EXT |
10 | #define BOOTDIR "/.rockbox" | 10 | #define BOOTDIR "/.rockbox" |
11 | 11 | ||
12 | /* Define EROSQN_VER as an "extradefine" in the configure script - | ||
13 | * v1, v2 players: "1" | ||
14 | * v3 players: "3" | ||
15 | * Only bootloader will be affected. | ||
16 | * | ||
17 | * This allows us to fix the LCD init issues with v3 players. | ||
18 | */ | ||
19 | #ifdef BOOTLOADER | ||
20 | #ifndef EROSQN_VER | ||
21 | #error "Must define EROSQN_VER" | ||
22 | #endif | ||
23 | #endif | ||
24 | |||
12 | /* CPU defines */ | 25 | /* CPU defines */ |
13 | #define CONFIG_CPU X1000 | 26 | #define CONFIG_CPU X1000 |
14 | #define X1000_EXCLK_FREQ 24000000 | 27 | #define X1000_EXCLK_FREQ 24000000 |
@@ -77,9 +90,7 @@ | |||
77 | #define CONFIG_STORAGE STORAGE_SD | 90 | #define CONFIG_STORAGE STORAGE_SD |
78 | #define HAVE_HOTSWAP | 91 | #define HAVE_HOTSWAP |
79 | #define HAVE_HOTSWAP_STORAGE_AS_MAIN | 92 | #define HAVE_HOTSWAP_STORAGE_AS_MAIN |
80 | #define HAVE_MULTIDRIVE | ||
81 | #define HAVE_MULTIVOLUME | 93 | #define HAVE_MULTIVOLUME |
82 | #define NUM_DRIVES 1 | ||
83 | #define STORAGE_WANTS_ALIGN | 94 | #define STORAGE_WANTS_ALIGN |
84 | #define STORAGE_NEEDS_BOUNCE_BUFFER | 95 | #define STORAGE_NEEDS_BOUNCE_BUFFER |
85 | 96 | ||
@@ -108,6 +119,9 @@ | |||
108 | #define HAVE_BOOTDATA | 119 | #define HAVE_BOOTDATA |
109 | #define BOOT_REDIR "rockbox_main.aigo_erosqn" | 120 | #define BOOT_REDIR "rockbox_main.aigo_erosqn" |
110 | 121 | ||
122 | /* DeviceData */ | ||
123 | #define HAVE_DEVICEDATA | ||
124 | |||
111 | /* USB support */ | 125 | /* USB support */ |
112 | #ifndef SIMULATOR | 126 | #ifndef SIMULATOR |
113 | #define CONFIG_USBOTG USBOTG_DESIGNWARE | 127 | #define CONFIG_USBOTG USBOTG_DESIGNWARE |
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 @@ | |||
161 | No access to the NAND yet.. | 161 | No 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 @@ | |||
152 | No access to the NAND yet.. | 152 | No 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/devicedata.h b/firmware/export/devicedata.h new file mode 100644 index 0000000000..c19b0ca25d --- /dev/null +++ b/firmware/export/devicedata.h | |||
@@ -0,0 +1,94 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2017 by Amaury Pouly | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License | ||
13 | * as published by the Free Software Foundation; either version 2 | ||
14 | * of the License, or (at your option) any later version. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | #ifndef __RB_DEVICEDATA__ | ||
21 | #define __RB_DEVICEDATA__ | ||
22 | |||
23 | #ifndef __ASSEMBLER__ | ||
24 | #include <stdint.h> | ||
25 | #include "system.h" | ||
26 | #endif | ||
27 | |||
28 | /* /!\ This file can be included in assembly files /!\ */ | ||
29 | |||
30 | /** The device data will be filled by the bootloader with information that might | ||
31 | * be relevant for Rockbox. The bootloader will search for the structure using | ||
32 | * the magic header within the first DEVICE_DATA_SEARCH_SIZE bytes of the binary. | ||
33 | * Typically, this structure should be as close as possible to the entry point */ | ||
34 | |||
35 | /* Search size for the data structure after entry point */ | ||
36 | #define DEVICE_DATA_SEARCH_SIZE 1024 | ||
37 | |||
38 | #define DEVICE_DATA_MAGIC0 ('r' | 'b' << 8 | 'd' << 16 | 'e' << 24) | ||
39 | #define DEVICE_DATA_MAGIC1 ('v' | 'i' << 8 | 'c' << 16 | 'e' << 24) | ||
40 | |||
41 | /* maximum size of payload */ | ||
42 | #define DEVICE_DATA_PAYLOAD_SIZE 4 | ||
43 | |||
44 | #ifndef __ASSEMBLER__ | ||
45 | /* This is the C structure */ | ||
46 | struct device_data_t | ||
47 | { | ||
48 | union | ||
49 | { | ||
50 | uint32_t crc; /* crc of payload data (CRC32 with 0xffffffff for initial value) */ | ||
51 | uint32_t magic[2]; /* DEVICE_DATA_MAGIC0/1 */ | ||
52 | }; | ||
53 | |||
54 | uint32_t length; /* length of the payload */ | ||
55 | |||
56 | /* add fields here */ | ||
57 | union | ||
58 | { | ||
59 | struct | ||
60 | { | ||
61 | #if defined(EROS_QN) | ||
62 | uint8_t lcd_version; | ||
63 | #endif | ||
64 | }; | ||
65 | uint8_t payload[DEVICE_DATA_PAYLOAD_SIZE]; | ||
66 | }; | ||
67 | } __attribute__((packed)); | ||
68 | |||
69 | |||
70 | void fill_devicedata(struct device_data_t *data); | ||
71 | bool write_devicedata(unsigned char* buf, int len); | ||
72 | #ifndef BOOTLOADER | ||
73 | extern struct device_data_t device_data; | ||
74 | |||
75 | void verify_device_data(void) INIT_ATTR; | ||
76 | |||
77 | #endif | ||
78 | |||
79 | #else /* __ASSEMBLER__ */ | ||
80 | |||
81 | /* This assembler macro implements an empty device data structure with just the magic | ||
82 | * string and payload size */ | ||
83 | .macro put_device_data_here | ||
84 | .global device_data | ||
85 | device_data: | ||
86 | .word DEVICE_DATA_MAGIC0 | ||
87 | .word DEVICE_DATA_MAGIC1 | ||
88 | .word DEVICE_DATA_PAYLOAD_SIZE | ||
89 | .space BOOT_DATA_PAYLOAD_SIZE, 0xff /* payload, initialised with value 0xff */ | ||
90 | .endm | ||
91 | |||
92 | #endif | ||
93 | |||
94 | #endif /* __RB_DEVICEDATA__ */ | ||
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 | ||
27 | struct partinfo | 27 | struct 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 */ |
174 | unsigned int fat_get_cluster_size(IF_MV_NONVOID(int volume)); | 174 | unsigned int fat_get_cluster_size(IF_MV_NONVOID(int volume)); |
175 | void fat_recalc_free(IF_MV_NONVOID(int volume)); | 175 | void fat_recalc_free(IF_MV_NONVOID(int volume)); |
176 | bool fat_size(IF_MV(int volume,) unsigned long *size, unsigned long *free); | 176 | bool fat_size(IF_MV(int volume,) sector_t *size, sector_t *free); |
177 | 177 | ||
178 | /** Misc. **/ | 178 | /** Misc. **/ |
179 | void fat_empty_fat_direntry(struct fat_direntry *entry); | 179 | void 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); | |||
37 | extern int hostfs_flush(void); | 37 | extern int hostfs_flush(void); |
38 | 38 | ||
39 | #ifdef HAVE_HOTSWAP | 39 | #ifdef HAVE_HOTSWAP |
40 | extern bool hostfs_removable(int drive); | 40 | extern bool hostfs_removable(IF_MD_NONVOID(int drive)); |
41 | extern bool hostfs_present(int drive); | 41 | extern 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); | |||
36 | int mmc_soft_reset(void); | 36 | int mmc_soft_reset(void); |
37 | int mmc_init(void) STORAGE_INIT_ATTR; | 37 | int mmc_init(void) STORAGE_INIT_ATTR; |
38 | void mmc_close(void); | 38 | void mmc_close(void); |
39 | int mmc_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); | 39 | int mmc_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf); |
40 | int mmc_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); | 40 | int mmc_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf); |
41 | void mmc_spin(void); | 41 | void mmc_spin(void); |
42 | int mmc_spinup_time(void); | 42 | int 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) | ||
46 | typedef uint64_t sector_t; | ||
47 | #define STORAGE_64BIT_SECTOR | ||
48 | #elif (CONFIG_STORAGE & STORAGE_SD) && defined(HAVE_SDUC) | ||
49 | typedef uint64_t sector_t; | ||
50 | #define STORAGE_64BIT_SECTOR | ||
51 | #else | ||
52 | typedef 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) */ |
114 | void volume_recalc_free(IF_MV_NONVOID(int volume)); | 128 | void volume_recalc_free(IF_MV_NONVOID(int volume)); |
115 | unsigned int volume_get_cluster_size(IF_MV_NONVOID(int volume)); | 129 | unsigned int volume_get_cluster_size(IF_MV_NONVOID(int volume)); |
116 | void volume_size(IF_MV(int volume,) unsigned long *size, unsigned long *free); | 130 | void volume_size(IF_MV(int volume,) sector_t *size, sector_t *free); |
117 | #ifdef HAVE_DIRCACHE | 131 | #ifdef HAVE_DIRCACHE |
118 | bool volume_ismounted(IF_MV_NONVOID(int volume)); | 132 | bool volume_ismounted(IF_MV_NONVOID(int volume)); |
119 | #endif | 133 | #endif |
120 | #ifdef HAVE_HOTSWAP | 134 | #ifdef HAVE_HOTSWAP |
121 | bool volume_removable(int volume); | 135 | bool volume_removable(int volume); |
122 | bool volume_present(int volume); | 136 | bool 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); | |||
36 | int nand_soft_reset(void); | 36 | int nand_soft_reset(void); |
37 | int nand_init(void) STORAGE_INIT_ATTR; | 37 | int nand_init(void) STORAGE_INIT_ATTR; |
38 | void nand_close(void); | 38 | void nand_close(void); |
39 | int nand_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); | 39 | int nand_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf); |
40 | int nand_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); | 40 | int 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 |
42 | int nand_flush(void); | 42 | int 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); | |||
82 | int path_strip_last_volume(const char *name, const char **nameptr, bool greedy); | 82 | int path_strip_last_volume(const char *name, const char **nameptr, bool greedy); |
83 | int get_volume_name(int volume, char *name); | 83 | int get_volume_name(int volume, char *name); |
84 | int make_volume_root(int volume, char *dst); | 84 | int make_volume_root(int volume, char *dst); |
85 | void init_volume_names(void); | ||
86 | int path_get_volume_id(const char *name); | ||
85 | #endif | 87 | #endif |
86 | 88 | ||
87 | int path_strip_drive(const char *name, const char **nameptr, bool greedy); | 89 | int 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); | |||
35 | int ramdisk_soft_reset(void); | 35 | int ramdisk_soft_reset(void); |
36 | int ramdisk_init(void) STORAGE_INIT_ATTR; | 36 | int ramdisk_init(void) STORAGE_INIT_ATTR; |
37 | void ramdisk_close(void); | 37 | void ramdisk_close(void); |
38 | int ramdisk_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); | 38 | int ramdisk_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf); |
39 | int ramdisk_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); | 39 | int ramdisk_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf); |
40 | void ramdisk_spin(void); | 40 | void ramdisk_spin(void); |
41 | void ramdisk_sleepnow(void); | 41 | void ramdisk_sleepnow(void); |
42 | int ramdisk_spinup_time(void); | 42 | int 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); | |||
42 | int sd_soft_reset(void); | 42 | int sd_soft_reset(void); |
43 | int sd_init(void) STORAGE_INIT_ATTR; | 43 | int sd_init(void) STORAGE_INIT_ATTR; |
44 | void sd_close(void); | 44 | void sd_close(void); |
45 | int sd_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); | 45 | int sd_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf); |
46 | int sd_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); | 46 | int sd_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf); |
47 | void sd_spin(void); | 47 | void sd_spin(void); |
48 | int sd_spinup_time(void); /* ticks */ | 48 | int 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 | ||
26 | typedef struct | 28 | typedef 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); | |||
107 | struct storage_info | 107 | struct 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 |
311 | bool storage_removable(int drive); | 311 | bool storage_removable(int drive); |
312 | bool storage_present(int drive); | 312 | bool storage_present(int drive); |
313 | #else | ||
314 | #define storage_removable(x) 0 | ||
315 | #define storage_present(x) 1 | ||
313 | #endif | 316 | #endif |
314 | int storage_driver_type(int drive); | 317 | int 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 | ||
318 | int storage_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); | 321 | int storage_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf); |
319 | int storage_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); | 322 | int storage_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf); |
320 | #endif | 323 | #endif |