summaryrefslogtreecommitdiff
path: root/firmware/target/arm/ata-target.h
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-08-01 10:43:45 +0000
committerJens Arnold <amiconn@rockbox.org>2007-08-01 10:43:45 +0000
commit174c7abdff92dbb35ec3524279444913d6e5fbf1 (patch)
treec0f80edae9b26cdba7733f1c771fba5233129ba6 /firmware/target/arm/ata-target.h
parentabf3435ca724bf6201c663f33c2e4394ae48156d (diff)
Add some new findings to the PP header files. * Clean up ata-target.h for PP. * check_registers() seems to work fine on PP5002.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14114 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/ata-target.h')
-rw-r--r--firmware/target/arm/ata-target.h40
1 files changed, 18 insertions, 22 deletions
diff --git a/firmware/target/arm/ata-target.h b/firmware/target/arm/ata-target.h
index d65a7b2822..f8755c38b3 100644
--- a/firmware/target/arm/ata-target.h
+++ b/firmware/target/arm/ata-target.h
@@ -23,9 +23,6 @@
/* Plain C reading and writing. See comment in ata-as-arm.S */
-#define ATA_IOBASE 0xc00031e0
-#define ATA_CONTROL (*((volatile unsigned char*)(0xc00033f8)))
-
#elif defined CPU_PP502x
/* asm optimized reading and writing */
@@ -34,19 +31,18 @@
void copy_read_sectors(unsigned char* buf, int wordcount);
void copy_write_sectors(const unsigned char* buf, int wordcount);
-#define ATA_IOBASE 0xc30001e0
-#define ATA_CONTROL (*((volatile unsigned char*)(0xc30003f8)))
-
#endif /* CONFIG_CPU */
-#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE)))
-#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE + 0x04)))
-#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x08)))
-#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x0c)))
-#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x10)))
-#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x14)))
-#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE + 0x18)))
-#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x1c)))
+/* primary channel */
+#define ATA_DATA (*((volatile unsigned short*)(IDE_BASE + 0x1e0)))
+#define ATA_ERROR (*((volatile unsigned char*)(IDE_BASE + 0x1e4)))
+#define ATA_NSECTOR (*((volatile unsigned char*)(IDE_BASE + 0x1e8)))
+#define ATA_SECTOR (*((volatile unsigned char*)(IDE_BASE + 0x1ec)))
+#define ATA_LCYL (*((volatile unsigned char*)(IDE_BASE + 0x1f0)))
+#define ATA_HCYL (*((volatile unsigned char*)(IDE_BASE + 0x1f4)))
+#define ATA_SELECT (*((volatile unsigned char*)(IDE_BASE + 0x1f8)))
+#define ATA_COMMAND (*((volatile unsigned char*)(IDE_BASE + 0x1fc)))
+#define ATA_CONTROL (*((volatile unsigned char*)(IDE_BASE + 0x3f8)))
#define STATUS_BSY 0x80
#define STATUS_RDY 0x40
@@ -55,15 +51,15 @@ void copy_write_sectors(const unsigned char* buf, int wordcount);
#define STATUS_ERR 0x01
#define ERROR_ABRT 0x04
-#define WRITE_PATTERN1 0xa5
-#define WRITE_PATTERN2 0x5a
-#define WRITE_PATTERN3 0xaa
-#define WRITE_PATTERN4 0x55
+#define WRITE_PATTERN1 0xa5
+#define WRITE_PATTERN2 0x5a
+#define WRITE_PATTERN3 0xaa
+#define WRITE_PATTERN4 0x55
-#define READ_PATTERN1 0xa5
-#define READ_PATTERN2 0x5a
-#define READ_PATTERN3 0xaa
-#define READ_PATTERN4 0x55
+#define READ_PATTERN1 0xa5
+#define READ_PATTERN2 0x5a
+#define READ_PATTERN3 0xaa
+#define READ_PATTERN4 0x55
#define READ_PATTERN1_MASK 0xff
#define READ_PATTERN2_MASK 0xff