PP5020: Unconditionally use stock PIO timings

The SSD detection heuristic is flawed, and when it fails
(due to very crappy CF->SD adapters) we end up corrupting things.

So let's give up a slight amount of performance on the original hard
drives (which are aging out anyway) in favor of guaranteeing safety.

Change-Id: Id92583a6b9ae6ec543b91b3e0f8f28b57ac38cb0
This commit is contained in:
Solomon Peachy 2024-07-16 16:03:27 -04:00
parent 9c53fa1b0a
commit 27a0cda6ac
2 changed files with 4 additions and 7 deletions

View file

@ -604,7 +604,7 @@ static void init(void)
{
lcd_clear_display();
lcd_puts(0, 0, "No partition");
lcd_puts(0, 1, "found.");
lcd_putsf(0, 1, "found (%d).", rc);
#ifndef USB_NONE
lcd_puts(0, 2, "Insert USB cable");
lcd_puts(0, 3, "and fix it.");

View file

@ -48,8 +48,8 @@ bool ata_is_coldstart()
rest are the same. They go in IDE0_PRI_TIMING0.
Rockbox used to use 0x10, and test_disk shows that leads to faster PIO.
However on some disks connected with mSATA adapters this causes corrupt data
so we now just use these timings from the OF.
However when used with mSATA and some SD adapters this causes corrupt data
so we now unconditionally use these timings from the OF.
*/
static const unsigned long pio80mhz[] = {
0xC293, 0x43A2, 0x11A1, 0x7232, 0x3131
@ -83,10 +83,7 @@ void ata_device_init()
/* Setup the timing for PIO mode */
void ata_set_pio_timings(int mode)
{
if (ata_disk_isssd())
IDE0_PRI_TIMING0 = pio80mhz[mode];
else
IDE0_PRI_TIMING0 = 0x10;
}
#ifdef HAVE_ATA_DMA