1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * arch/arm/include/asm/floppy.h
5 * Copyright (C) 1996-2000 Russell King
7 * Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
9 #ifndef __ASM_ARM_FLOPPY_H
10 #define __ASM_ARM_FLOPPY_H
12 #define fd_outb(val,port) \
14 int new_val = (val); \
15 if (((port) & 7) == FD_DOR) { \
17 new_val = (new_val & 0x0c) | \
18 floppy_selects[new_val & 3]; \
22 outb(new_val, (port)); \
25 #define fd_inb(port) inb((port))
26 #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
28 #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL)
29 #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
30 #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
32 static inline int fd_dma_setup(void *data
, unsigned int length
,
33 unsigned int mode
, unsigned long addr
)
35 set_dma_mode(DMA_FLOPPY
, mode
);
36 __set_dma_addr(DMA_FLOPPY
, data
);
37 set_dma_count(DMA_FLOPPY
, length
);
38 virtual_dma_port
= addr
;
39 enable_dma(DMA_FLOPPY
);
42 #define fd_dma_setup fd_dma_setup
44 #define fd_request_dma() request_dma(DMA_FLOPPY,"floppy")
45 #define fd_free_dma() free_dma(DMA_FLOPPY)
46 #define fd_disable_dma() disable_dma(DMA_FLOPPY)
48 /* need to clean up dma.h */
49 #define DMA_FLOPPYDISK DMA_FLOPPY
51 /* Floppy_selects is the list of DOR's to select drive fd
53 * On initialisation, the floppy list is scanned, and the drives allocated
54 * in the order that they are found. This is done by seeking the drive
55 * to a non-zero track, and then restoring it to track 0. If an error occurs,
56 * then there is no floppy drive present. [to be put back in again]
58 static unsigned char floppy_selects
[4] = { 0x10, 0x21, 0x23, 0x33 };
62 #define FLOPPY0_TYPE 4
63 #define FLOPPY1_TYPE 4
68 #define CROSS_64KB(a,s) (0)
71 * This allows people to reverse the order of
72 * fd0 and fd1, in case their hardware is
73 * strangely connected (as some RiscPCs
74 * and A5000s seem to be).
76 static void driveswap(int *ints
, int dummy
, int dummy2
)
78 swap(floppy_selects
[0], floppy_selects
[1]);
81 #define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }