summaryrefslogtreecommitdiff
path: root/firmware/target/arm/ata-target.h
diff options
context:
space:
mode:
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 @@
23 23
24/* Plain C reading and writing. See comment in ata-as-arm.S */ 24/* Plain C reading and writing. See comment in ata-as-arm.S */
25 25
26#define ATA_IOBASE 0xc00031e0
27#define ATA_CONTROL (*((volatile unsigned char*)(0xc00033f8)))
28
29#elif defined CPU_PP502x 26#elif defined CPU_PP502x
30 27
31/* asm optimized reading and writing */ 28/* asm optimized reading and writing */
@@ -34,19 +31,18 @@
34void copy_read_sectors(unsigned char* buf, int wordcount); 31void copy_read_sectors(unsigned char* buf, int wordcount);
35void copy_write_sectors(const unsigned char* buf, int wordcount); 32void copy_write_sectors(const unsigned char* buf, int wordcount);
36 33
37#define ATA_IOBASE 0xc30001e0
38#define ATA_CONTROL (*((volatile unsigned char*)(0xc30003f8)))
39
40#endif /* CONFIG_CPU */ 34#endif /* CONFIG_CPU */
41 35
42#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE))) 36/* primary channel */
43#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE + 0x04))) 37#define ATA_DATA (*((volatile unsigned short*)(IDE_BASE + 0x1e0)))
44#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x08))) 38#define ATA_ERROR (*((volatile unsigned char*)(IDE_BASE + 0x1e4)))
45#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x0c))) 39#define ATA_NSECTOR (*((volatile unsigned char*)(IDE_BASE + 0x1e8)))
46#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x10))) 40#define ATA_SECTOR (*((volatile unsigned char*)(IDE_BASE + 0x1ec)))
47#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x14))) 41#define ATA_LCYL (*((volatile unsigned char*)(IDE_BASE + 0x1f0)))
48#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE + 0x18))) 42#define ATA_HCYL (*((volatile unsigned char*)(IDE_BASE + 0x1f4)))
49#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x1c))) 43#define ATA_SELECT (*((volatile unsigned char*)(IDE_BASE + 0x1f8)))
44#define ATA_COMMAND (*((volatile unsigned char*)(IDE_BASE + 0x1fc)))
45#define ATA_CONTROL (*((volatile unsigned char*)(IDE_BASE + 0x3f8)))
50 46
51#define STATUS_BSY 0x80 47#define STATUS_BSY 0x80
52#define STATUS_RDY 0x40 48#define STATUS_RDY 0x40
@@ -55,15 +51,15 @@ void copy_write_sectors(const unsigned char* buf, int wordcount);
55#define STATUS_ERR 0x01 51#define STATUS_ERR 0x01
56#define ERROR_ABRT 0x04 52#define ERROR_ABRT 0x04
57 53
58#define WRITE_PATTERN1 0xa5 54#define WRITE_PATTERN1 0xa5
59#define WRITE_PATTERN2 0x5a 55#define WRITE_PATTERN2 0x5a
60#define WRITE_PATTERN3 0xaa 56#define WRITE_PATTERN3 0xaa
61#define WRITE_PATTERN4 0x55 57#define WRITE_PATTERN4 0x55
62 58
63#define READ_PATTERN1 0xa5 59#define READ_PATTERN1 0xa5
64#define READ_PATTERN2 0x5a 60#define READ_PATTERN2 0x5a
65#define READ_PATTERN3 0xaa 61#define READ_PATTERN3 0xaa
66#define READ_PATTERN4 0x55 62#define READ_PATTERN4 0x55
67 63
68#define READ_PATTERN1_MASK 0xff 64#define READ_PATTERN1_MASK 0xff
69#define READ_PATTERN2_MASK 0xff 65#define READ_PATTERN2_MASK 0xff