diff options
Diffstat (limited to 'include/asm-sparc/ide.h')
-rw-r--r-- | include/asm-sparc/ide.h | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h index afd1736ed480..879fcec72dc1 100644 --- a/include/asm-sparc/ide.h +++ b/include/asm-sparc/ide.h | |||
@@ -10,9 +10,16 @@ | |||
10 | 10 | ||
11 | #ifdef __KERNEL__ | 11 | #ifdef __KERNEL__ |
12 | 12 | ||
13 | #include <asm/pgtable.h> | ||
14 | #include <asm/io.h> | 13 | #include <asm/io.h> |
14 | #ifdef CONFIG_SPARC64 | ||
15 | #include <asm/pgalloc.h> | ||
16 | #include <asm/spitfire.h> | ||
17 | #include <asm/cacheflush.h> | ||
18 | #include <asm/page.h> | ||
19 | #else | ||
20 | #include <asm/pgtable.h> | ||
15 | #include <asm/psr.h> | 21 | #include <asm/psr.h> |
22 | #endif | ||
16 | 23 | ||
17 | #undef MAX_HWIFS | 24 | #undef MAX_HWIFS |
18 | #define MAX_HWIFS 2 | 25 | #define MAX_HWIFS 2 |
@@ -28,50 +35,46 @@ | |||
28 | #define __ide_mm_outsw __ide_outsw | 35 | #define __ide_mm_outsw __ide_outsw |
29 | #define __ide_mm_outsl __ide_outsl | 36 | #define __ide_mm_outsl __ide_outsl |
30 | 37 | ||
31 | static inline void __ide_insw(unsigned long port, | 38 | static inline void __ide_insw(void __iomem *port, void *dst, u32 count) |
32 | void *dst, | ||
33 | unsigned long count) | ||
34 | { | 39 | { |
35 | volatile unsigned short *data_port; | 40 | #if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE) |
36 | /* unsigned long end = (unsigned long)dst + (count << 1); */ /* P3 */ | 41 | unsigned long end = (unsigned long)dst + (count << 1); |
42 | #endif | ||
37 | u16 *ps = dst; | 43 | u16 *ps = dst; |
38 | u32 *pi; | 44 | u32 *pi; |
39 | 45 | ||
40 | data_port = (volatile unsigned short *)port; | ||
41 | |||
42 | if(((unsigned long)ps) & 0x2) { | 46 | if(((unsigned long)ps) & 0x2) { |
43 | *ps++ = *data_port; | 47 | *ps++ = __raw_readw(port); |
44 | count--; | 48 | count--; |
45 | } | 49 | } |
46 | pi = (u32 *)ps; | 50 | pi = (u32 *)ps; |
47 | while(count >= 2) { | 51 | while(count >= 2) { |
48 | u32 w; | 52 | u32 w; |
49 | 53 | ||
50 | w = (*data_port) << 16; | 54 | w = __raw_readw(port) << 16; |
51 | w |= (*data_port); | 55 | w |= __raw_readw(port); |
52 | *pi++ = w; | 56 | *pi++ = w; |
53 | count -= 2; | 57 | count -= 2; |
54 | } | 58 | } |
55 | ps = (u16 *)pi; | 59 | ps = (u16 *)pi; |
56 | if(count) | 60 | if(count) |
57 | *ps++ = *data_port; | 61 | *ps++ = __raw_readw(port); |
58 | 62 | ||
59 | /* __flush_dcache_range((unsigned long)dst, end); */ /* P3 see hme */ | 63 | #if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE) |
64 | __flush_dcache_range((unsigned long)dst, end); | ||
65 | #endif | ||
60 | } | 66 | } |
61 | 67 | ||
62 | static inline void __ide_outsw(unsigned long port, | 68 | static inline void __ide_outsw(void __iomem *port, const void *src, u32 count) |
63 | const void *src, | ||
64 | unsigned long count) | ||
65 | { | 69 | { |
66 | volatile unsigned short *data_port; | 70 | #if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE) |
67 | /* unsigned long end = (unsigned long)src + (count << 1); */ | 71 | unsigned long end = (unsigned long)src + (count << 1); |
72 | #endif | ||
68 | const u16 *ps = src; | 73 | const u16 *ps = src; |
69 | const u32 *pi; | 74 | const u32 *pi; |
70 | 75 | ||
71 | data_port = (volatile unsigned short *)port; | ||
72 | |||
73 | if(((unsigned long)src) & 0x2) { | 76 | if(((unsigned long)src) & 0x2) { |
74 | *data_port = *ps++; | 77 | __raw_writew(*ps++, port); |
75 | count--; | 78 | count--; |
76 | } | 79 | } |
77 | pi = (const u32 *)ps; | 80 | pi = (const u32 *)ps; |
@@ -79,15 +82,17 @@ static inline void __ide_outsw(unsigned long port, | |||
79 | u32 w; | 82 | u32 w; |
80 | 83 | ||
81 | w = *pi++; | 84 | w = *pi++; |
82 | *data_port = (w >> 16); | 85 | __raw_writew((w >> 16), port); |
83 | *data_port = w; | 86 | __raw_writew(w, port); |
84 | count -= 2; | 87 | count -= 2; |
85 | } | 88 | } |
86 | ps = (const u16 *)pi; | 89 | ps = (const u16 *)pi; |
87 | if(count) | 90 | if(count) |
88 | *data_port = *ps; | 91 | __raw_writew(*ps, port); |
89 | 92 | ||
90 | /* __flush_dcache_range((unsigned long)src, end); */ /* P3 see hme */ | 93 | #if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE) |
94 | __flush_dcache_range((unsigned long)src, end); | ||
95 | #endif | ||
91 | } | 96 | } |
92 | 97 | ||
93 | #endif /* __KERNEL__ */ | 98 | #endif /* __KERNEL__ */ |