summaryrefslogtreecommitdiffstats
path: root/firmware/target/sh/archos/ata-archos.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-12-19 09:27:41 +0000
committerJens Arnold <amiconn@rockbox.org>2006-12-19 09:27:41 +0000
commit28fd4b7228620f915dd837d401abaab8c353e89c (patch)
tree4780a2f9148990e67980a3267cc0ed53acd778a2 /firmware/target/sh/archos/ata-archos.c
parent3bceded79373a43ee75487a5bd037723c92e089b (diff)
downloadrockbox-28fd4b7228620f915dd837d401abaab8c353e89c.tar.gz
rockbox-28fd4b7228620f915dd837d401abaab8c353e89c.zip
Archos: Moved the ata_address_detect() code into ata_device_init(), removing the associated #ifdef and some public #defines. Saves a tiny bit of code as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11812 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/sh/archos/ata-archos.c')
-rwxr-xr-xfirmware/target/sh/archos/ata-archos.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/firmware/target/sh/archos/ata-archos.c b/firmware/target/sh/archos/ata-archos.c
index 73e56b8d84..c685700fa3 100755
--- a/firmware/target/sh/archos/ata-archos.c
+++ b/firmware/target/sh/archos/ata-archos.c
@@ -25,6 +25,9 @@
#include "ata-target.h"
#include "hwcompat.h"
+#define ATA_CONTROL1 ((volatile unsigned char*)0x06200206)
+#define ATA_CONTROL2 ((volatile unsigned char*)0x06200306)
+
volatile unsigned char* ata_control;
int ata_io_address; /* 0x300 or 0x200 */
@@ -39,20 +42,6 @@ void ata_reset(void)
sleep(1); /* > 2ms */
}
-void ata_address_detect(void)
-{
- if (read_hw_mask() & ATA_ADDRESS_200)
- {
- ata_io_address = 0x200; /* For debug purposes only */
- ata_control = ATA_CONTROL1;
- }
- else
- {
- ata_io_address = 0x300; /* For debug purposes only */
- ata_control = ATA_CONTROL2;
- }
-}
-
void ata_enable(bool on)
{
if(on)
@@ -68,6 +57,17 @@ void ata_device_init(void)
or_b(0x02, &PAIORH); /* output for ATA reset */
or_b(0x02, &PADRH); /* release ATA reset */
PACR2 &= 0xBFFF; /* GPIO function for PA7 (IDE enable) */
+
+ if (read_hw_mask() & ATA_ADDRESS_200)
+ {
+ ata_io_address = 0x200; /* For debug purposes only */
+ ata_control = ATA_CONTROL1;
+ }
+ else
+ {
+ ata_io_address = 0x300; /* For debug purposes only */
+ ata_control = ATA_CONTROL2;
+ }
}
bool ata_is_coldstart(void)