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.h7
-rw-r--r--firmware/export/config/erosqnative.h16
-rw-r--r--firmware/export/devicedata.h94
-rw-r--r--firmware/export/disk.h4
-rw-r--r--firmware/export/fat.h4
-rw-r--r--firmware/export/mmc.h4
-rw-r--r--firmware/export/mv.h16
-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.h6
15 files changed, 167 insertions, 33 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 5e5425a697..ede1825f88 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -893,12 +893,13 @@ Lyre prototype 1 */
893#endif 893#endif
894 894
895/* Bootloaders don't need multivolume awareness */ 895/* Bootloaders don't need multivolume awareness */
896#if defined(BOOTLOADER) && defined(HAVE_MULTIVOLUME) && !(CONFIG_PLATFORM & PLATFORM_HOSTED) 896#if defined(BOOTLOADER) && defined(HAVE_MULTIVOLUME) \
897 && !(CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(BOOT_REDIR)
897#undef HAVE_MULTIVOLUME 898#undef HAVE_MULTIVOLUME
898#endif 899#endif
899 900
900/* Explicit HAVE_MULTIVOLUME in the config file. Allow the maximum number */ 901/* Number of volumes per drive */
901#ifdef HAVE_MULTIVOLUME 902#if defined(HAVE_MULTIVOLUME) && !defined(SIMULATOR) && !(CONFIG_PLATFORM & PLATFORM_HOSTED)
902#define NUM_VOLUMES_PER_DRIVE 4 903#define NUM_VOLUMES_PER_DRIVE 4
903#else 904#else
904#define NUM_VOLUMES_PER_DRIVE 1 905#define NUM_VOLUMES_PER_DRIVE 1
diff --git a/firmware/export/config/erosqnative.h b/firmware/export/config/erosqnative.h
index 26073a5f34..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
@@ -106,6 +119,9 @@
106#define HAVE_BOOTDATA 119#define HAVE_BOOTDATA
107#define BOOT_REDIR "rockbox_main.aigo_erosqn" 120#define BOOT_REDIR "rockbox_main.aigo_erosqn"
108 121
122/* DeviceData */
123#define HAVE_DEVICEDATA
124
109/* USB support */ 125/* USB support */
110#ifndef SIMULATOR 126#ifndef SIMULATOR
111#define CONFIG_USBOTG USBOTG_DESIGNWARE 127#define CONFIG_USBOTG USBOTG_DESIGNWARE
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 */
46struct 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
70void fill_devicedata(struct device_data_t *data);
71bool write_devicedata(unsigned char* buf, int len);
72#ifndef BOOTLOADER
73extern struct device_data_t device_data;
74
75void 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
85device_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
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/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 1122c7b85f..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,7 +127,7 @@ 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
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 b72cccc257..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;
@@ -318,6 +318,6 @@ int storage_driver_type(int drive);
318 318
319#endif /* NOT CONFIG_STORAGE_MULTI and NOT SIMULATOR*/ 319#endif /* NOT CONFIG_STORAGE_MULTI and NOT SIMULATOR*/
320 320
321int 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);
322int 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);
323#endif 323#endif