diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-07-02 14:23:30 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-07-02 14:23:30 +0000 |
| commit | 1639e9820283a3cf368518135db208d10b2d1b47 (patch) | |
| tree | da6a12bad93e27646f11854cdfb02ad96cc4a020 | |
| parent | 7c441258ff887c7f7461a2d85e4d2bde6051ad96 (diff) | |
| download | rockbox-1639e9820283a3cf368518135db208d10b2d1b47.zip rockbox-1639e9820283a3cf368518135db208d10b2d1b47.tar.gz rockbox-1639e9820283a3cf368518135db208d10b2d1b47.tar.bz2 rockbox-1639e9820283a3cf368518135db208d10b2d1b47.tar.xz | |
Added some debug information
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1298 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/drivers/ata.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index e8fd446..63bfc92 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -62,7 +62,8 @@ #define CMD_SECURITY_FREEZE_LOCK 0xF5 static struct mutex ata_mtx; -static char device; /* device 0 (master) or 1 (slave) */ +char ata_device; /* device 0 (master) or 1 (slave) */ +int ata_io_address; /* 0x300 or 0x200, only valid on recorder */ static volatile unsigned char* ata_control; @@ -126,7 +127,7 @@ int ata_read_sectors(unsigned long start, ATA_SECTOR = start & 0xff; ATA_LCYL = (start >> 8) & 0xff; ATA_HCYL = (start >> 16) & 0xff; - ATA_SELECT = ((start >> 24) & 0xf) | SELECT_LBA | device; + ATA_SELECT = ((start >> 24) & 0xf) | SELECT_LBA | ata_device; ATA_COMMAND = CMD_READ_SECTORS; for (i=0; i<count; i++) { @@ -177,7 +178,7 @@ int ata_write_sectors(unsigned long start, ATA_SECTOR = start & 0xff; ATA_LCYL = (start >> 8) & 0xff; ATA_HCYL = (start >> 16) & 0xff; - ATA_SELECT = ((start >> 24) & 0xf) | SELECT_LBA | device; + ATA_SELECT = ((start >> 24) & 0xf) | SELECT_LBA | ata_device; ATA_COMMAND = CMD_WRITE_SECTORS; for (i=0; i<count; i++) { @@ -299,7 +300,7 @@ int ata_soft_reset(void) mutex_lock(&ata_mtx); - ATA_SELECT = SELECT_LBA | device; + ATA_SELECT = SELECT_LBA | ata_device; ATA_CONTROL = CONTROL_nIEN|CONTROL_SRST; sleep(HZ/20000); /* >= 5us */ @@ -325,14 +326,14 @@ static int master_slave_detect(void) /* master? */ ATA_SELECT = 0; if ( ATA_STATUS & STATUS_RDY ) { - device = 0; + ata_device = 0; DEBUGF("Found master harddisk\n"); } else { /* slave? */ ATA_SELECT = SELECT_DEVICE1; if ( ATA_STATUS & STATUS_RDY ) { - device = SELECT_DEVICE1; + ata_device = SELECT_DEVICE1; DEBUGF("Found slave harddisk\n"); } else @@ -360,12 +361,14 @@ static int io_address_detect(void) if(tmp == ((*ATA_CONTROL2) & 0xf9)) { DEBUGF("CONTROL is at 0x306\n"); + ata_io_address = 0x300; /* For debug purposes only */ old_recorder = true; ata_control = ATA_CONTROL2; } else { DEBUGF("CONTROL is at 0x206\n"); + ata_io_address = 0x200; /* For debug purposes only */ old_recorder = false; ata_control = ATA_CONTROL1; } |