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 <linux/config.h>
14 #include <asm/pgalloc.h>
17 #include <asm/spitfire.h>
20 # ifdef CONFIG_BLK_DEV_IDEPCI
27 static __inline__ int ide_default_irq(unsigned long base)
32 static __inline__ unsigned long ide_default_io_base(int index)
37 #define IDE_ARCH_OBSOLETE_INIT
38 #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
40 #define ide_init_default_irq(base) (0)
42 #define __ide_insl(data_reg, buffer, wcount) \
43 __ide_insw(data_reg, buffer, (wcount)<<1)
44 #define __ide_outsl(data_reg, buffer, wcount) \
45 __ide_outsw(data_reg, buffer, (wcount)<<1)
47 /* On sparc64, I/O ports and MMIO registers are accessed identically. */
48 #define __ide_mm_insw __ide_insw
49 #define __ide_mm_insl __ide_insl
50 #define __ide_mm_outsw __ide_outsw
51 #define __ide_mm_outsl __ide_outsl
53 static __inline__ unsigned int inw_be(unsigned long addr)
57 __asm__ __volatile__("lduha [%1] %2, %0"
59 : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
64 static __inline__ void __ide_insw(unsigned long port,
68 #if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
69 unsigned long end = (unsigned long)dst + (count << 1);
82 w = inw_be(port) << 16;
91 #if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
92 __flush_dcache_range((unsigned long)dst, end);
96 static __inline__ void outw_be(unsigned short w, unsigned long addr)
98 __asm__ __volatile__("stha %0, [%1] %2"
100 : "r" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
103 static __inline__ void __ide_outsw(unsigned long port,
107 #if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
108 unsigned long end = (unsigned long)src + (count << 1);
113 if(((u64)src) & 0x2) {
114 outw_be(*ps++, port);
117 pi = (const u32 *)ps;
122 outw_be((w >> 16), port);
126 ps = (const u16 *)pi;
130 #if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
131 __flush_dcache_range((unsigned long)src, end);
135 #endif /* __KERNEL__ */
137 #endif /* _SPARC64_IDE_H */