aboutsummaryrefslogtreecommitdiff
path: root/include/asm-sparc/ide.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-25 11:37:07 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-25 11:37:07 +0200
commit0e2f65ee30eee2db054f7fd73f462c5da33ec963 (patch)
tree26c61eb7745da0c0d9135e9d12088f570cb8530d /include/asm-sparc/ide.h
parentda7878d75b8520c9ae00d27dfbbce546a7bfdfbb (diff)
parentfb2e405fc1fc8b20d9c78eaa1c7fd5a297efde43 (diff)
Merge branch 'linus' into x86/pebs
Conflicts: arch/x86/Kconfig.cpu arch/x86/kernel/cpu/intel.c arch/x86/kernel/setup_64.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-sparc/ide.h')
-rw-r--r--include/asm-sparc/ide.h58
1 files changed, 30 insertions, 28 deletions
diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h
index afd1736ed48..b7af3d65823 100644
--- a/include/asm-sparc/ide.h
+++ b/include/asm-sparc/ide.h
@@ -10,12 +10,16 @@
#ifdef __KERNEL__
-#include <asm/pgtable.h>
#include <asm/io.h>
+#ifdef CONFIG_SPARC64
+#include <asm/pgalloc.h>
+#include <asm/spitfire.h>
+#include <asm/cacheflush.h>
+#include <asm/page.h>
+#else
+#include <asm/pgtable.h>
#include <asm/psr.h>
-
-#undef MAX_HWIFS
-#define MAX_HWIFS 2
+#endif
#define __ide_insl(data_reg, buffer, wcount) \
__ide_insw(data_reg, buffer, (wcount)<<1)
@@ -28,50 +32,46 @@
#define __ide_mm_outsw __ide_outsw
#define __ide_mm_outsl __ide_outsl
-static inline void __ide_insw(unsigned long port,
- void *dst,
- unsigned long count)
+static inline void __ide_insw(void __iomem *port, void *dst, u32 count)
{
- volatile unsigned short *data_port;
- /* unsigned long end = (unsigned long)dst + (count << 1); */ /* P3 */
+#if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE)
+ unsigned long end = (unsigned long)dst + (count << 1);
+#endif
u16 *ps = dst;
u32 *pi;
- data_port = (volatile unsigned short *)port;
-
if(((unsigned long)ps) & 0x2) {
- *ps++ = *data_port;
+ *ps++ = __raw_readw(port);
count--;
}
pi = (u32 *)ps;
while(count >= 2) {
u32 w;
- w = (*data_port) << 16;
- w |= (*data_port);
+ w = __raw_readw(port) << 16;
+ w |= __raw_readw(port);
*pi++ = w;
count -= 2;
}
ps = (u16 *)pi;
if(count)
- *ps++ = *data_port;
+ *ps++ = __raw_readw(port);
- /* __flush_dcache_range((unsigned long)dst, end); */ /* P3 see hme */
+#if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE)
+ __flush_dcache_range((unsigned long)dst, end);
+#endif
}
-static inline void __ide_outsw(unsigned long port,
- const void *src,
- unsigned long count)
+static inline void __ide_outsw(void __iomem *port, const void *src, u32 count)
{
- volatile unsigned short *data_port;
- /* unsigned long end = (unsigned long)src + (count << 1); */
+#if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE)
+ unsigned long end = (unsigned long)src + (count << 1);
+#endif
const u16 *ps = src;
const u32 *pi;
- data_port = (volatile unsigned short *)port;
-
if(((unsigned long)src) & 0x2) {
- *data_port = *ps++;
+ __raw_writew(*ps++, port);
count--;
}
pi = (const u32 *)ps;
@@ -79,15 +79,17 @@ static inline void __ide_outsw(unsigned long port,
u32 w;
w = *pi++;
- *data_port = (w >> 16);
- *data_port = w;
+ __raw_writew((w >> 16), port);
+ __raw_writew(w, port);
count -= 2;
}
ps = (const u16 *)pi;
if(count)
- *data_port = *ps;
+ __raw_writew(*ps, port);
- /* __flush_dcache_range((unsigned long)src, end); */ /* P3 see hme */
+#if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE)
+ __flush_dcache_range((unsigned long)src, end);
+#endif
}
#endif /* __KERNEL__ */