xref: /OK3568_Linux_fs/kernel/arch/mips/include/asm/floppy.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Architecture specific parts of the Floppy driver
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * This file is subject to the terms and conditions of the GNU General Public
5*4882a593Smuzhiyun  * License.  See the file "COPYING" in the main directory of this archive
6*4882a593Smuzhiyun  * for more details.
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * Copyright (C) 1995 - 2000 Ralf Baechle
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun #ifndef _ASM_FLOPPY_H
11*4882a593Smuzhiyun #define _ASM_FLOPPY_H
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #include <asm/io.h>
14*4882a593Smuzhiyun 
fd_cacheflush(char * addr,long size)15*4882a593Smuzhiyun static inline void fd_cacheflush(char * addr, long size)
16*4882a593Smuzhiyun {
17*4882a593Smuzhiyun 	dma_cache_wback_inv((unsigned long)addr, size);
18*4882a593Smuzhiyun }
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun #define MAX_BUFFER_SECTORS 24
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun /*
24*4882a593Smuzhiyun  * And on Mips's the CMOS info fails also ...
25*4882a593Smuzhiyun  *
26*4882a593Smuzhiyun  * FIXME: This information should come from the ARC configuration tree
27*4882a593Smuzhiyun  *	  or wherever a particular machine has stored this ...
28*4882a593Smuzhiyun  */
29*4882a593Smuzhiyun #define FLOPPY0_TYPE		fd_drive_type(0)
30*4882a593Smuzhiyun #define FLOPPY1_TYPE		fd_drive_type(1)
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #define FDC1			fd_getfdaddr1()
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun #define N_FDC 1			/* do you *really* want a second controller? */
35*4882a593Smuzhiyun #define N_DRIVE 8
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun /*
38*4882a593Smuzhiyun  * The DMA channel used by the floppy controller cannot access data at
39*4882a593Smuzhiyun  * addresses >= 16MB
40*4882a593Smuzhiyun  *
41*4882a593Smuzhiyun  * Went back to the 1MB limit, as some people had problems with the floppy
42*4882a593Smuzhiyun  * driver otherwise. It doesn't matter much for performance anyway, as most
43*4882a593Smuzhiyun  * floppy accesses go through the track buffer.
44*4882a593Smuzhiyun  *
45*4882a593Smuzhiyun  * On MIPSes using vdma, this actually means that *all* transfers go thru
46*4882a593Smuzhiyun  * the * track buffer since 0x1000000 is always smaller than KSEG0/1.
47*4882a593Smuzhiyun  * Actually this needs to be a bit more complicated since the so much different
48*4882a593Smuzhiyun  * hardware available with MIPS CPUs ...
49*4882a593Smuzhiyun  */
50*4882a593Smuzhiyun #define CROSS_64KB(a, s) ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)
51*4882a593Smuzhiyun 
52*4882a593Smuzhiyun #define EXTRA_FLOPPY_PARAMS
53*4882a593Smuzhiyun 
54*4882a593Smuzhiyun #include <floppy.h>
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun #endif /* _ASM_FLOPPY_H */
57