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.h33
1 files changed, 19 insertions, 14 deletions
diff --git a/firmware/target/arm/ata-target.h b/firmware/target/arm/ata-target.h
index f8755c38b3..a029d457ce 100644
--- a/firmware/target/arm/ata-target.h
+++ b/firmware/target/arm/ata-target.h
@@ -19,20 +19,6 @@
19 19
20#ifdef CPU_PP 20#ifdef CPU_PP
21 21
22#if (CONFIG_CPU == PP5002)
23
24/* Plain C reading and writing. See comment in ata-as-arm.S */
25
26#elif defined CPU_PP502x
27
28/* asm optimized reading and writing */
29#define ATA_OPTIMIZED_READING
30#define ATA_OPTIMIZED_WRITING
31void copy_read_sectors(unsigned char* buf, int wordcount);
32void copy_write_sectors(const unsigned char* buf, int wordcount);
33
34#endif /* CONFIG_CPU */
35
36/* primary channel */ 22/* primary channel */
37#define ATA_DATA (*((volatile unsigned short*)(IDE_BASE + 0x1e0))) 23#define ATA_DATA (*((volatile unsigned short*)(IDE_BASE + 0x1e0)))
38#define ATA_ERROR (*((volatile unsigned char*)(IDE_BASE + 0x1e4))) 24#define ATA_ERROR (*((volatile unsigned char*)(IDE_BASE + 0x1e4)))
@@ -66,9 +52,28 @@ void copy_write_sectors(const unsigned char* buf, int wordcount);
66#define READ_PATTERN3_MASK 0xff 52#define READ_PATTERN3_MASK 0xff
67#define READ_PATTERN4_MASK 0xff 53#define READ_PATTERN4_MASK 0xff
68 54
55#if (CONFIG_CPU == PP5002)
56
57#define SET_REG(reg,val) do { reg = (val); \
58 while (!(IDE_CFG_STATUS & 0x40)); \
59 } while (0)
60#define SET_16BITREG(reg,val) reg = (val)
61
62/* Plain C reading and writing. See comment in ata-as-arm.S */
63
64#elif defined CPU_PP502x
65
69#define SET_REG(reg,val) reg = (val) 66#define SET_REG(reg,val) reg = (val)
70#define SET_16BITREG(reg,val) reg = (val) 67#define SET_16BITREG(reg,val) reg = (val)
71 68
69/* asm optimized reading and writing */
70#define ATA_OPTIMIZED_READING
71#define ATA_OPTIMIZED_WRITING
72void copy_read_sectors(unsigned char* buf, int wordcount);
73void copy_write_sectors(const unsigned char* buf, int wordcount);
74
75#endif /* CONFIG_CPU */
76
72#endif 77#endif
73 78
74void ata_reset(void); 79void ata_reset(void);