1 /* $Id: ide.h,v 1.21 2001/09/25 20:21:48 kanoj Exp $
2 * ide.h: Ultra/PCI specific IDE glue.
4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
13 #include <asm/pgalloc.h>
15 #include <asm/spitfire.h>
16 #include <asm/cacheflush.h>
20 # ifdef CONFIG_BLK_DEV_IDEPCI
27 #define __ide_insl(data_reg, buffer, wcount) \
28 __ide_insw(data_reg, buffer, (wcount)<<1)
29 #define __ide_outsl(data_reg, buffer, wcount) \
30 __ide_outsw(data_reg, buffer, (wcount)<<1)
32 /* On sparc64, I/O ports and MMIO registers are accessed identically. */
33 #define __ide_mm_insw __ide_insw
34 #define __ide_mm_insl __ide_insl
35 #define __ide_mm_outsw __ide_outsw
36 #define __ide_mm_outsl __ide_outsl
38 static inline unsigned int inw_be(void __iomem *addr)
42 __asm__ __volatile__("lduha [%1] %2, %0"
44 : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
49 static inline void __ide_insw(void __iomem *port, void *dst, u32 count)
51 #ifdef DCACHE_ALIASING_POSSIBLE
52 unsigned long end = (unsigned long)dst + (count << 1);
65 w = inw_be(port) << 16;
74 #ifdef DCACHE_ALIASING_POSSIBLE
75 __flush_dcache_range((unsigned long)dst, end);
79 static inline void outw_be(unsigned short w, void __iomem *addr)
81 __asm__ __volatile__("stha %0, [%1] %2"
83 : "r" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
86 static inline void __ide_outsw(void __iomem *port, void *src, u32 count)
88 #ifdef DCACHE_ALIASING_POSSIBLE
89 unsigned long end = (unsigned long)src + (count << 1);
94 if(((u64)src) & 0x2) {
103 outw_be((w >> 16), port);
107 ps = (const u16 *)pi;
111 #ifdef DCACHE_ALIASING_POSSIBLE
112 __flush_dcache_range((unsigned long)src, end);
116 #endif /* __KERNEL__ */
118 #endif /* _SPARC64_IDE_H */