mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
ATA: Add some more logf debugging
Change-Id: If1f919c43d02a974e478018750c60e3619db1505
This commit is contained in:
parent
461704f803
commit
044ba60bcf
2 changed files with 16 additions and 0 deletions
|
|
@ -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;
|
timeout = current_tick + READWRITE_TIMEOUT;
|
||||||
|
|
||||||
ATA_OUT8(ATA_SELECT, ata_device);
|
ATA_OUT8(ATA_SELECT, ata_device);
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
//#define LOGF_ENABLE
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
@ -32,6 +34,7 @@
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "panic.h"
|
#include "panic.h"
|
||||||
#include "fs_defines.h"
|
#include "fs_defines.h"
|
||||||
|
#include "logf.h"
|
||||||
|
|
||||||
#ifndef ATA_RETRIES
|
#ifndef ATA_RETRIES
|
||||||
#define ATA_RETRIES 3
|
#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)
|
static int ata_power_up(void)
|
||||||
{
|
{
|
||||||
|
logf("ata POWERUP %ld", current_tick);
|
||||||
|
|
||||||
ata_set_active();
|
ata_set_active();
|
||||||
ide_power_enable(true);
|
ide_power_enable(true);
|
||||||
long spinup_start = current_tick;
|
long spinup_start = current_tick;
|
||||||
|
|
@ -775,6 +780,9 @@ static void ata_power_down(void)
|
||||||
{
|
{
|
||||||
if (!ata_powered)
|
if (!ata_powered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
logf("ata POWERDOWN %ld", current_tick);
|
||||||
|
|
||||||
PCON(7) = 0;
|
PCON(7) = 0;
|
||||||
PCON(8) = 0;
|
PCON(8) = 0;
|
||||||
PCON(9) = 0;
|
PCON(9) = 0;
|
||||||
|
|
@ -909,6 +917,8 @@ static int ata_transfer_sectors(uint64_t sector, uint32_t count, void* buffer, b
|
||||||
if (!ceata)
|
if (!ceata)
|
||||||
ATA_COMMAND = BIT(1);
|
ATA_COMMAND = BIT(1);
|
||||||
|
|
||||||
|
logf("ata XFER (%d) %d @ %llu", write, count, sector);
|
||||||
|
|
||||||
while (count)
|
while (count)
|
||||||
{
|
{
|
||||||
uint32_t cnt = MIN(ata_lba48 ? 65536 : 256, count);
|
uint32_t cnt = MIN(ata_lba48 ? 65536 : 256, count);
|
||||||
|
|
@ -1044,6 +1054,8 @@ static void ata_flush_cache(void)
|
||||||
{
|
{
|
||||||
uint8_t cmd;
|
uint8_t cmd;
|
||||||
|
|
||||||
|
logf("ata FLUSH CACHE %ld", current_tick);
|
||||||
|
|
||||||
if (ceata) {
|
if (ceata) {
|
||||||
memset(ceata_taskfile, 0, 16);
|
memset(ceata_taskfile, 0, 16);
|
||||||
ceata_taskfile[0xf] = CMD_FLUSH_CACHE_EXT; /* CE-ATA only supports EXT */
|
ceata_taskfile[0xf] = CMD_FLUSH_CACHE_EXT; /* CE-ATA only supports EXT */
|
||||||
|
|
@ -1089,6 +1101,8 @@ void ata_sleepnow(void)
|
||||||
ata_flush_cache();
|
ata_flush_cache();
|
||||||
|
|
||||||
if (ata_disk_can_sleep()) {
|
if (ata_disk_can_sleep()) {
|
||||||
|
logf("ata SLEEP %ld", current_tick);
|
||||||
|
|
||||||
if (ceata) {
|
if (ceata) {
|
||||||
memset(ceata_taskfile, 0, 16);
|
memset(ceata_taskfile, 0, 16);
|
||||||
ceata_taskfile[0xf] = CMD_STANDBY_IMMEDIATE;
|
ceata_taskfile[0xf] = CMD_STANDBY_IMMEDIATE;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue