summaryrefslogtreecommitdiff
path: root/firmware/export/ata.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/ata.h')
-rw-r--r--firmware/export/ata.h20
1 files changed, 11 insertions, 9 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__ */