24 #undef MAX_DMA_ADDRESS
25 #define MAX_DMA_ADDRESS 0x00
31 #define FLOPPY0_TYPE (MACH_IS_Q40 ? 6 : 4)
32 #define FLOPPY1_TYPE 0
35 #define FDC1 m68k_floppy_init()
43 static int virtual_dma_count=0;
44 static int virtual_dma_residue=0;
45 static char *virtual_dma_addr=
NULL;
46 static int virtual_dma_mode=0;
47 static int doing_pdma=0;
62 spin_unlock_irqrestore(&dma_spin_lock, flags);
71 return sun3x_82072_fd_inb(port);
80 sun3x_82072_fd_outb(value, port);
90 return sun3xflop_request_irq();
100 #define fd_request_dma() vdma_request_dma(FLOPPY_DMA,"floppy")
101 #define fd_get_dma_residue() vdma_get_dma_residue(FLOPPY_DMA)
102 #define fd_dma_mem_alloc(size) vdma_mem_alloc(size)
103 #define fd_dma_setup(addr, size, mode, io) vdma_dma_setup(addr, size, mode, io)
105 #define fd_enable_irq()
106 #define fd_disable_irq()
108 #define fd_free_dma()
111 #define CROSS_64KB(a,s) (0)
113 #define DMA_MODE_READ 0x44
114 #define DMA_MODE_WRITE 0x48
117 static int m68k_floppy_init(
void)
120 can_use_virtual_dma = 1;
126 return sun3xflop_init();
132 static int vdma_request_dma(
unsigned int dmanr,
const char *
device_id)
138 static int vdma_get_dma_residue(
unsigned int dummy)
140 return virtual_dma_count + virtual_dma_residue;
144 static unsigned long vdma_mem_alloc(
unsigned long size)
146 return (
unsigned long)
vmalloc(size);
150 static void _fd_dma_mem_free(
unsigned long addr,
unsigned long size)
154 #define fd_dma_mem_free(addr,size) _fd_dma_mem_free(addr, size)
159 static int vdma_dma_setup(
char *addr,
unsigned long size,
int mode,
int io)
164 virtual_dma_addr =
addr;
165 virtual_dma_count =
size;
166 virtual_dma_residue = 0;
175 virtual_dma_residue += virtual_dma_count;
185 register unsigned char st;
187 #undef TRACE_FLPY_INT
188 #define NO_FLOPPY_ASSEMBLER
190 #ifdef TRACE_FLPY_INT
193 static int dma_wait=0;
200 #ifdef TRACE_FLPY_INT
202 bytes = virtual_dma_count;
212 for(lcount=virtual_dma_count, lptr=virtual_dma_addr;
213 lcount; lcount--, lptr++) {
214 st=
inb(virtual_dma_port+4) & 0xa0 ;
218 outb_p(*lptr, virtual_dma_port+5);
220 *lptr =
inb_p(virtual_dma_port+5);
223 virtual_dma_count = lcount;
224 virtual_dma_addr = lptr;
225 st =
inb(virtual_dma_port+4);
228 #ifdef TRACE_FLPY_INT
234 virtual_dma_residue += virtual_dma_count;
236 #ifdef TRACE_FLPY_INT
237 printk(
"count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n",
238 virtual_dma_count, virtual_dma_residue, calls, bytes,
247 #ifdef TRACE_FLPY_INT
248 if(!virtual_dma_count)
254 #define EXTRA_FLOPPY_PARAMS