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:
Solomon Peachy 2024-07-16 17:34:26 -04:00
parent 27a0cda6ac
commit 942e013eac

View file

@ -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;
}