Merge branch 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / arch / arm / include / asm / floppy.h
CommitLineData
d2912cb1 1/* SPDX-License-Identifier: GPL-2.0-only */
1da177e4 2/*
4baa9922 3 * arch/arm/include/asm/floppy.h
1da177e4
LT
4 *
5 * Copyright (C) 1996-2000 Russell King
6 *
1da177e4
LT
7 * Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
8 */
9#ifndef __ASM_ARM_FLOPPY_H
10#define __ASM_ARM_FLOPPY_H
1da177e4 11
fc0c5c0c
WT
12#define fd_outb(val,port) \
13 do { \
14 int new_val = (val); \
e2032464 15 if (((port) & 7) == FD_DOR) { \
fc0c5c0c
WT
16 if (new_val & 0xf0) \
17 new_val = (new_val & 0x0c) | \
18 floppy_selects[new_val & 3]; \
19 else \
20 new_val &= 0x0c; \
21 } \
22 outb(new_val, (port)); \
1da177e4
LT
23 } while(0)
24
25#define fd_inb(port) inb((port))
26#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
57c06a8e 27 0,"floppy",NULL)
1da177e4
LT
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)
31
21d1ca04
RK
32static inline int fd_dma_setup(void *data, unsigned int length,
33 unsigned int mode, unsigned long addr)
34{
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);
40 return 0;
41}
42#define fd_dma_setup fd_dma_setup
43
1da177e4
LT
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)
1da177e4
LT
47
48/* need to clean up dma.h */
49#define DMA_FLOPPYDISK DMA_FLOPPY
50
51/* Floppy_selects is the list of DOR's to select drive fd
52 *
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]
57 */
336eae37 58static unsigned char floppy_selects[4] = { 0x10, 0x21, 0x23, 0x33 };
1da177e4 59
1da177e4
LT
60#define FDC1 (0x3f0)
61
62#define FLOPPY0_TYPE 4
63#define FLOPPY1_TYPE 4
64
65#define N_FDC 1
66#define N_DRIVE 4
67
1da177e4
LT
68#define CROSS_64KB(a,s) (0)
69
70/*
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).
75 */
76static void driveswap(int *ints, int dummy, int dummy2)
77{
336eae37 78 swap(floppy_selects[0], floppy_selects[1]);
1da177e4
LT
79}
80
81#define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
82
83#endif