diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-12-19 09:27:41 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-12-19 09:27:41 +0000 |
commit | 28fd4b7228620f915dd837d401abaab8c353e89c (patch) | |
tree | 4780a2f9148990e67980a3267cc0ed53acd778a2 /firmware/target/sh/archos | |
parent | 3bceded79373a43ee75487a5bd037723c92e089b (diff) | |
download | rockbox-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')
-rwxr-xr-x | firmware/target/sh/archos/ata-archos.c | 28 | ||||
-rwxr-xr-x | firmware/target/sh/archos/ata-target.h | 3 |
2 files changed, 14 insertions, 17 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) diff --git a/firmware/target/sh/archos/ata-target.h b/firmware/target/sh/archos/ata-target.h index ddffb34f5a..ae9329387d 100755 --- a/firmware/target/sh/archos/ata-target.h +++ b/firmware/target/sh/archos/ata-target.h @@ -22,14 +22,11 @@ /* asm optimised read & write loops */ #define ATA_OPTIMIZED_READING #define ATA_OPTIMIZED_WRITING -#define ATA_ADDRESS_DETECT /* need address detection */ #define SWAP_WORDS #define ATA_IOBASE 0x06100100 #define ATA_DATA (*((volatile unsigned short*)0x06104100)) -#define ATA_CONTROL1 ((volatile unsigned char*)0x06200206) -#define ATA_CONTROL2 ((volatile unsigned char*)0x06200306) #define ATA_CONTROL (*ata_control) #define ATA_ERROR (*((volatile unsigned char*)ATA_IOBASE + 1)) |