mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
pp5020: Cache the result of the is_ssd check.
...So we don't look it up on every write. Change-Id: I85b0abe5032a60588535b401cc719661601807ee
This commit is contained in:
parent
27a0cda6ac
commit
942e013eac
1 changed files with 5 additions and 1 deletions
|
|
@ -106,6 +106,8 @@ static bool dma_boosted = false;
|
|||
static bool dma_needs_boost;
|
||||
#endif
|
||||
|
||||
static int ata_is_ssd = 0;
|
||||
|
||||
/* This function sets up registers for 80 Mhz.
|
||||
Ultra DMA mode 2 works at 30 Mhz.
|
||||
*/
|
||||
|
|
@ -133,6 +135,8 @@ void ata_dma_set_mode(unsigned char mode) {
|
|||
#if !defined(IPOD_NANO)
|
||||
IDE0_CFG |= 0x20000000; /* >= 50 Mhz */
|
||||
#endif
|
||||
|
||||
ata_is_ssd = ata_disk_isssd();
|
||||
}
|
||||
|
||||
#define IDE_CFG_INTRQ 8
|
||||
|
|
@ -175,7 +179,7 @@ bool ata_dma_setup(void *addr, unsigned long bytes, bool write) {
|
|||
if (write) {
|
||||
if ((unsigned long)addr & 3)
|
||||
return false;
|
||||
if (!ata_disk_isssd())
|
||||
if (!ata_is_ssd)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue