summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-11-11 21:15:45 -0500
committerSolomon Peachy <pizza@shaftnet.org>2024-11-12 08:11:18 -0500
commit044ba60bcfbf74c26ba859b8a5ad41832486a707 (patch)
tree5d7879ea40f5bf77daabc172da87d6773dd70c45
parent461704f803be3e88d9b8a4621778bd8f00e487ac (diff)
downloadrockbox-044ba60bcf.tar.gz
rockbox-044ba60bcf.zip
ATA: Add some more logf debugging
Change-Id: If1f919c43d02a974e478018750c60e3619db1505
-rw-r--r--firmware/drivers/ata.c2
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c14
2 files changed, 16 insertions, 0 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index f73e4c7d5b..04b6b15b08 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -414,6 +414,8 @@ static int ata_transfer_sectors(uint64_t start,
}
}
+ logf("ata XFER (%d) %d @ %llu", write, incount, start);
+
timeout = current_tick + READWRITE_TIMEOUT;
ATA_OUT8(ATA_SELECT, ata_device);
diff --git a/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c b/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c
index 3aff2edd49..5c1bc02a57 100644
--- a/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c
@@ -18,6 +18,8 @@
* KIND, either express or implied.
*
****************************************************************************/
+//#define LOGF_ENABLE
+
#include "config.h"
#include "storage.h"
#include "timer.h"
@@ -32,6 +34,7 @@
#include "debug.h"
#include "panic.h"
#include "fs_defines.h"
+#include "logf.h"
#ifndef ATA_RETRIES
#define ATA_RETRIES 3
@@ -652,6 +655,8 @@ static int ata_get_best_mode(unsigned short identword, int max, int modetype)
*/
static int ata_power_up(void)
{
+ logf("ata POWERUP %ld", current_tick);
+
ata_set_active();
ide_power_enable(true);
long spinup_start = current_tick;
@@ -775,6 +780,9 @@ static void ata_power_down(void)
{
if (!ata_powered)
return;
+
+ logf("ata POWERDOWN %ld", current_tick);
+
PCON(7) = 0;
PCON(8) = 0;
PCON(9) = 0;
@@ -909,6 +917,8 @@ static int ata_transfer_sectors(uint64_t sector, uint32_t count, void* buffer, b
if (!ceata)
ATA_COMMAND = BIT(1);
+ logf("ata XFER (%d) %d @ %llu", write, count, sector);
+
while (count)
{
uint32_t cnt = MIN(ata_lba48 ? 65536 : 256, count);
@@ -1044,6 +1054,8 @@ static void ata_flush_cache(void)
{
uint8_t cmd;
+ logf("ata FLUSH CACHE %ld", current_tick);
+
if (ceata) {
memset(ceata_taskfile, 0, 16);
ceata_taskfile[0xf] = CMD_FLUSH_CACHE_EXT; /* CE-ATA only supports EXT */
@@ -1089,6 +1101,8 @@ void ata_sleepnow(void)
ata_flush_cache();
if (ata_disk_can_sleep()) {
+ logf("ata SLEEP %ld", current_tick);
+
if (ceata) {
memset(ceata_taskfile, 0, 16);
ceata_taskfile[0xf] = CMD_STANDBY_IMMEDIATE;