2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Access the floppy hardware on PC style hardware
8 * Copyright (C) 1996, 1997, 1998 by Ralf Baechle
10 #include <linux/delay.h>
11 #include <linux/init.h>
12 #include <linux/ioport.h>
13 #include <linux/sched.h>
14 #include <linux/kernel.h>
15 #include <linux/linkage.h>
16 #include <linux/types.h>
18 #include <asm/bootinfo.h>
19 #include <asm/cachectl.h>
21 #include <asm/floppy.h>
22 #include <asm/keyboard.h>
25 #include <asm/mc146818rtc.h>
26 #include <asm/pgtable.h>
29 * How to access the FDC's registers.
31 static unsigned char std_fd_inb(unsigned int port)
36 static void std_fd_outb(unsigned char value, unsigned int port)
42 * How to access the floppy DMA functions.
44 static void std_fd_enable_dma(int channel)
49 static void std_fd_disable_dma(int channel)
54 static int std_fd_request_dma(int channel)
56 return request_dma(channel, "floppy");
59 static void std_fd_free_dma(int channel)
64 static void std_fd_clear_dma_ff(int channel)
66 clear_dma_ff(channel);
69 static void std_fd_set_dma_mode(int channel, char mode)
71 set_dma_mode(channel, mode);
74 static void std_fd_set_dma_addr(int channel, unsigned int addr)
76 set_dma_addr(channel, addr);
79 static void std_fd_set_dma_count(int channel, unsigned int count)
81 set_dma_count(channel, count);
84 static int std_fd_get_dma_residue(int channel)
86 return get_dma_residue(channel);
89 static void std_fd_enable_irq(int irq)
94 static void std_fd_disable_irq(int irq)
99 static unsigned long std_fd_getfdaddr1(void)
104 static unsigned long std_fd_dma_mem_alloc(unsigned long size)
108 mem = __get_dma_pages(GFP_KERNEL,get_order(size));
113 static void std_fd_dma_mem_free(unsigned long addr, unsigned long size)
115 free_pages(addr, get_order(size));
118 static unsigned long std_fd_drive_type(unsigned long n)
121 return 4; /* 3,5", 1.44mb */
126 struct fd_ops std_fd_ops = {
128 * How to access the floppy controller's ports
133 * How to access the floppy DMA functions.
142 std_fd_set_dma_count,
143 std_fd_get_dma_residue,
147 std_fd_dma_mem_alloc,