[PATCH] w1: Adds a sysfs entry (w1_master_search) that allows you to disable/enable...
[linux-2.6/verdex.git] / include / asm-arm / floppy.h
blob6ea657c886b98859056bf06d9aee865299a985ed
1 /*
2 * linux/include/asm-arm/floppy.h
4 * Copyright (C) 1996-2000 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
12 #ifndef __ASM_ARM_FLOPPY_H
13 #define __ASM_ARM_FLOPPY_H
14 #if 0
15 #include <asm/arch/floppy.h>
16 #endif
18 #define fd_outb(val,port) \
19 do { \
20 if ((port) == FD_DOR) \
21 fd_setdor((val)); \
22 else \
23 outb((val),(port)); \
24 } while(0)
26 #define fd_inb(port) inb((port))
27 #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
28 SA_INTERRUPT|SA_SAMPLE_RANDOM,"floppy",NULL)
29 #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL)
30 #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
31 #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
33 #define fd_request_dma() request_dma(DMA_FLOPPY,"floppy")
34 #define fd_free_dma() free_dma(DMA_FLOPPY)
35 #define fd_disable_dma() disable_dma(DMA_FLOPPY)
36 #define fd_enable_dma() enable_dma(DMA_FLOPPY)
37 #define fd_clear_dma_ff() clear_dma_ff(DMA_FLOPPY)
38 #define fd_set_dma_mode(mode) set_dma_mode(DMA_FLOPPY, (mode))
39 #define fd_set_dma_addr(addr) set_dma_addr(DMA_FLOPPY, virt_to_bus((addr)))
40 #define fd_set_dma_count(len) set_dma_count(DMA_FLOPPY, (len))
41 #define fd_cacheflush(addr,sz)
43 /* need to clean up dma.h */
44 #define DMA_FLOPPYDISK DMA_FLOPPY
46 /* Floppy_selects is the list of DOR's to select drive fd
48 * On initialisation, the floppy list is scanned, and the drives allocated
49 * in the order that they are found. This is done by seeking the drive
50 * to a non-zero track, and then restoring it to track 0. If an error occurs,
51 * then there is no floppy drive present. [to be put back in again]
53 static unsigned char floppy_selects[2][4] =
55 { 0x10, 0x21, 0x23, 0x33 },
56 { 0x10, 0x21, 0x23, 0x33 }
59 #define fd_setdor(dor) \
60 do { \
61 int new_dor = (dor); \
62 if (new_dor & 0xf0) \
63 new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3]; \
64 else \
65 new_dor &= 0x0c; \
66 outb(new_dor, FD_DOR); \
67 } while (0)
70 * Someday, we'll automatically detect which drives are present...
72 static inline void fd_scandrives (void)
74 #if 0
75 int floppy, drive_count;
77 fd_disable_irq();
78 raw_cmd = &default_raw_cmd;
79 raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_SEEK;
80 raw_cmd->track = 0;
81 raw_cmd->rate = ?;
82 drive_count = 0;
83 for (floppy = 0; floppy < 4; floppy ++) {
84 current_drive = drive_count;
86 * Turn on floppy motor
88 if (start_motor(redo_fd_request))
89 continue;
91 * Set up FDC
93 fdc_specify();
95 * Tell FDC to recalibrate
97 output_byte(FD_RECALIBRATE);
98 LAST_OUT(UNIT(floppy));
99 /* wait for command to complete */
100 if (!successful) {
101 int i;
102 for (i = drive_count; i < 3; i--)
103 floppy_selects[fdc][i] = floppy_selects[fdc][i + 1];
104 floppy_selects[fdc][3] = 0;
105 floppy -= 1;
106 } else
107 drive_count++;
109 #else
110 floppy_selects[0][0] = 0x10;
111 floppy_selects[0][1] = 0x21;
112 floppy_selects[0][2] = 0x23;
113 floppy_selects[0][3] = 0x33;
114 #endif
117 #define FDC1 (0x3f0)
119 #define FLOPPY0_TYPE 4
120 #define FLOPPY1_TYPE 4
122 #define N_FDC 1
123 #define N_DRIVE 4
125 #define FLOPPY_MOTOR_MASK 0xf0
127 #define CROSS_64KB(a,s) (0)
130 * This allows people to reverse the order of
131 * fd0 and fd1, in case their hardware is
132 * strangely connected (as some RiscPCs
133 * and A5000s seem to be).
135 static void driveswap(int *ints, int dummy, int dummy2)
137 floppy_selects[0][0] ^= floppy_selects[0][1];
138 floppy_selects[0][1] ^= floppy_selects[0][0];
139 floppy_selects[0][0] ^= floppy_selects[0][1];
142 #define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
144 #endif