summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-07-16 16:03:27 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-07-16 17:35:53 -0400
commit27a0cda6ac36f9be7309e4b963d5383299651c23 (patch)
tree7ec241187a422ae16627abd8a2ddc128d4e36a48
parent9c53fa1b0ad35c314c5b18775856032fb200bcbb (diff)
downloadrockbox-27a0cda6ac36f9be7309e4b963d5383299651c23.tar.gz
rockbox-27a0cda6ac36f9be7309e4b963d5383299651c23.zip
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
-rw-r--r--apps/main.c2
-rw-r--r--firmware/target/arm/pp/ata-pp5020.c9
2 files changed, 4 insertions, 7 deletions
diff --git a/apps/main.c b/apps/main.c
index 20b9a0bc55..0a104576e1 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -604,7 +604,7 @@ static void init(void)
604 { 604 {
605 lcd_clear_display(); 605 lcd_clear_display();
606 lcd_puts(0, 0, "No partition"); 606 lcd_puts(0, 0, "No partition");
607 lcd_puts(0, 1, "found."); 607 lcd_putsf(0, 1, "found (%d).", rc);
608#ifndef USB_NONE 608#ifndef USB_NONE
609 lcd_puts(0, 2, "Insert USB cable"); 609 lcd_puts(0, 2, "Insert USB cable");
610 lcd_puts(0, 3, "and fix it."); 610 lcd_puts(0, 3, "and fix it.");
diff --git a/firmware/target/arm/pp/ata-pp5020.c b/firmware/target/arm/pp/ata-pp5020.c
index f247a44171..396e684019 100644
--- a/firmware/target/arm/pp/ata-pp5020.c
+++ b/firmware/target/arm/pp/ata-pp5020.c
@@ -48,8 +48,8 @@ bool ata_is_coldstart()
48 rest are the same. They go in IDE0_PRI_TIMING0. 48 rest are the same. They go in IDE0_PRI_TIMING0.
49 49
50 Rockbox used to use 0x10, and test_disk shows that leads to faster PIO. 50 Rockbox used to use 0x10, and test_disk shows that leads to faster PIO.
51 However on some disks connected with mSATA adapters this causes corrupt data 51 However when used with mSATA and some SD adapters this causes corrupt data
52 so we now just use these timings from the OF. 52 so we now unconditionally use these timings from the OF.
53*/ 53*/
54static const unsigned long pio80mhz[] = { 54static const unsigned long pio80mhz[] = {
55 0xC293, 0x43A2, 0x11A1, 0x7232, 0x3131 55 0xC293, 0x43A2, 0x11A1, 0x7232, 0x3131
@@ -83,10 +83,7 @@ void ata_device_init()
83/* Setup the timing for PIO mode */ 83/* Setup the timing for PIO mode */
84void ata_set_pio_timings(int mode) 84void ata_set_pio_timings(int mode)
85{ 85{
86 if (ata_disk_isssd()) 86 IDE0_PRI_TIMING0 = pio80mhz[mode];
87 IDE0_PRI_TIMING0 = pio80mhz[mode];
88 else
89 IDE0_PRI_TIMING0 = 0x10;
90} 87}
91 88
92#ifdef HAVE_ATA_DMA 89#ifdef HAVE_ATA_DMA